1 #ifndef CondCore_CondDB_Serialization_h
2 #define CondCore_CondDB_Serialization_h
23 #include <boost/shared_ptr.hpp>
48 void write(
const std::type_info& sourceType,
const void* sourceInstance);
55 write(
typeid(
T), &instance );
70 void read(
const std::type_info& destinationType,
void* destinationInstance);
78 read(
typeid(
T), &instance );
91 std::ostringstream buffer;
95 ret.
copy( buffer.str() );
106 boost::shared_ptr<T> payload;
107 if( !unpackingOnly ){
109 sbuf.pubsetbuf( static_cast<char*>(const_cast<void*>(payloadData.
data())), payloadData.
size() );
111 std::istream buffer( &sbuf );
113 payload.reset( createPayload<T>(payloadType) );
116 payload = boost::static_pointer_cast<
T>(payloadData.
share());
static PFTauRenderPlugin instance
std::string demangledName(const std::type_info &typeInfo)
void write(const std::type_info &sourceType, const void *sourceInstance)
T * createPayload(const std::string &payloadTypeName)
void copy(const std::string &source)
RootOutputArchive(std::ostream &destination)
const void * data() const
RootOutputArchive & operator<<(const T &instance)
void throwException(std::string const &message, std::string const &methodName)
boost::shared_ptr< T > deserialize(const std::string &payloadType, const Binary &payloadData, bool unpackingOnly=false)
Binary serialize(const T &payload, bool packingOnly=false)
RootInputArchive CondInputArchive
RootOutputArchive CondOutputArchive
static std::string const source
boost::shared_ptr< void > share() const