47 #define NCBI_USE_ERRCODE_X Serial_TypeInfo
53 :
CParent(pointerType->GetSize(),
56 &GetPtrIndex, &SetPtrIndex, &ResetPtrIndex)
79 "invalid argument: must be CPointerTypeInfo");
86 "invalid argument: data must be CClassTypeInfo");
101 for ( CClassTypeInfo::TSubClasses::const_iterator
i = subclasses->begin();
102 i != subclasses->end(); ++
i ) {
104 if ( !variantType ) {
106 variantType = nullTypeInfo;
110 if ( variantType == nullTypeInfo ) {
121 "conflict subclasses: "+variantType->
GetName());
143 if ( v == variants.
end() )
145 "incompatible CChoicePointerTypeInfo type");
185 if ( objectPtr != 0 ) {
186 in.ThrowError(
in.fInvalidData,
187 "non-null value when reading NULL member");
194 if ( objectPtr != 0 ) {
195 out.ThrowError(
out.fInvalidData,
196 "non-null value when writing NULL member");
static CSafeStatic< CTypeInfoMap > s_ChoicePointerTypeInfo_map
static void Copy(CObjectStreamCopier &copier, TTypeInfo)
static void Skip(CObjectIStream &in, TTypeInfo)
static void Write(CObjectOStream &out, TTypeInfo, TConstObjectPtr objectPtr)
static void Read(CObjectIStream &in, TTypeInfo, TObjectPtr objectPtr)
static TObjectPtr Create(TTypeInfo, CObjectMemoryPool *)
Root class for all serialization exceptions.
CTypeInfo class contains all information about C++ types (both basic and classes): members and layout...
container_type::const_iterator const_iterator
const_iterator end() const
iterator_bool insert(const value_type &val)
container_type::value_type value_type
const_iterator find(const key_type &key) const
std::ofstream out("events_result.xml")
main entry point for tests
#define ERR_POST_X(err_subcode, message)
Error posting with default error code and given error subcode.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
CVariantInfo * SetSubClass(void)
TTypeInfo GetTypeInfo(void) const
TMemberIndex LastIndex(void) const
const TMemberIndex kEmptyChoice
Special value for marking empty choice.
size_t TMemberIndex
Type used for indexing class members and choice variants.
const void * TConstObjectPtr
static const TObjectType * SafeCast(TTypeInfo type)
virtual void ReadNull(void)=0
CObjectIStream & In(void) const
CObjectOStream & Out(void) const
virtual void WriteNull(void)=0
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
void SetWriteFunction(TTypeWriteFunction func)
const string & GetName(void) const
Get name of this type.
void SetPointerType(TTypeInfo pointerType)
void SetObjectPointer(TObjectPtr object, TObjectPtr pointer) const
virtual CTypeInfo * SetTag(CAsnBinaryDefs::TLongTag tag, CAsnBinaryDefs::ETagClass tagclass=CAsnBinaryDefs::eUniversal, CAsnBinaryDefs::ETagType tagtype=CAsnBinaryDefs::eAutomatic)
ETypeFamily GetTypeFamily(void) const
TTypeInfo GetPointedType(void) const
TMemberIndex m_NullPointerIndex
const CPointerTypeInfo * m_PointerTypeInfo
const CItemsInfo & GetVariants(void) const
const CVariantInfo * GetVariantInfo(TMemberIndex index) const
static CTypeInfo * CreateTypeInfo(TTypeInfo base)
CChoicePointerTypeInfo(TTypeInfo pointerType)
const TSubClasses * SubClasses(void) const
static void SetPtrIndex(const CChoiceTypeInfo *choiceType, TObjectPtr choicePtr, TMemberIndex index, CObjectMemoryPool *memPool)
TVariantsByType m_VariantsByType
list< pair< CMemberId, CTypeRef > > TSubClasses
void SetSkipFunction(TTypeSkipFunction func)
static TTypeInfo GetTypeInfo(void)
const type_info * GetCPlusPlusTypeInfo(TConstObjectPtr object) const
void SetCreateFunction(TTypeCreate func)
TConstObjectPtr GetObjectPointer(TConstObjectPtr object) const
void SetCopyFunction(TTypeCopyFunction func)
static TMemberIndex GetPtrIndex(const CChoiceTypeInfo *choiceType, TConstObjectPtr choicePtr)
static void ResetPtrIndex(const CChoiceTypeInfo *choiceType, TObjectPtr choicePtr)
static TTypeInfo GetTypeInfo(TTypeInfo base)
CVariantInfo * AddVariant(const char *variantId, const void *variantPtr, const CTypeRef &variantType)
TObjectPtr Create(CObjectMemoryPool *memoryPool=0) const
Create object of this type on heap (can be deleted by operator delete)
void SetReadFunction(TTypeReadFunction func)
Definition of all error codes used in serial libraries (xser.lib, xcser.lib).
Static variables safety - create on demand, destroy on application termination.
std::istream & in(std::istream &in_, double &x_)