summaryrefslogtreecommitdiff
path: root/p2pvr/daemon/sqlSelectDeserializer.h
blob: 0c32811ef3096effa8a24b1d2bdf9ec7c9ea348c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef P2PVR_SQL_DESERIALIZER_H
#define P2PVR_SQL_DESERIALIZER_H

#include <slicer/serializer.h>
#include <selectcommand.h>

class NoRowsReturned : public std::exception {  };

class SqlSelectDeserializer : public Slicer::Deserializer {
	public:
		SqlSelectDeserializer(DB::SelectCommand &, IceUtil::Optional<std::string> typeIdCol = IceUtil::Optional<std::string>());

		virtual void Deserialize(Slicer::ModelPartPtr) override;

	protected:
		void DeserializeSimple(Slicer::ModelPartPtr);
		void DeserializeObject(Slicer::ModelPartPtr);
		void DeserializeSequence(Slicer::ModelPartPtr);
		void DeserializeRow(Slicer::ModelPartPtr);

		DB::SelectCommand & cmd;
		unsigned int columnCount;
		IceUtil::Optional<std::string> typeIdColName;
		IceUtil::Optional<unsigned int> typeIdColIdx;
};

#endif