71 #if defined(NCBI_OS_MSWIN)
78 #define _TRACE(arg) ((void)0)
80 #define NCBI_USE_ERRCODE_X Serial_IStream
89 const string& fileName,
95 #if defined(NCBI_OS_MSWIN)
113 "CObjectIStream::Open: unsupported format");
122 if (s_MmapSrc->
Get()) {
136 if ( deleteInStream ) {
159 "CObjectIStream::Open: unsupported format");
174 stream->
Open(reader);
204 const string& fileName,
236 TSerialVerifyData::ResetThreadDefault();
238 TSerialVerifyData::SetThreadDefault(
verify);
250 TSerialVerifyData::ResetDefault();
252 TSerialVerifyData::SetDefault(
verify);
261 now = TSerialVerifyData::GetDefault();
308 return s_SerialFixChars->
Get();
351 TSkipUnknownMembersDefault::ResetThreadDefault();
364 TSkipUnknownMembersDefault::ResetDefault();
398 TSkipUnknownVariantsDefault::ResetThreadDefault();
400 TSkipUnknownVariantsDefault::SetThreadDefault(skip);
411 TSkipUnknownVariantsDefault::ResetDefault();
413 TSkipUnknownVariantsDefault::SetDefault(skip);
422 now = TSkipUnknownVariantsDefault::GetDefault();
459 : m_DiscardCurrObject(
false),
461 m_ParseDelayBuffers(eDelayBufferPolicyNotSet),
463 m_NonPrintSubst(
'#'),
464 m_FixMethod(x_GetFixCharsMethodDefault()),
465 m_VerifyData(x_GetVerifyDataDefault()),
471 m_MemberDefault(0), m_SpecialCaseToExpect(0), m_SpecialCaseUsed(eReadAsNormal)
560 if ( !old &&
flags ) {
618 Unended(
"internal error: unended object stack frame");
894 const string& tname = typeInfo->
GetName();
895 if ( !name.empty() && !tname.empty() && name != tname ) {
897 "incompatible type "+name+
"<>"+typeInfo->
GetName());
933 if ((*t)->GetName() == name) {
937 return matching_types;
1038 "member "+
info->GetId().ToString()+
" expected");
1087 objectPtr = typeInfo->
Create();
1094 return make_pair(objectPtr, typeInfo);
1099 ReadObject(
object.GetObjectPtr(),
object.GetTypeInfo());
1116 const CVariantInfo* variantInfo =
object.GetVariantInfo();
1117 TObjectPtr choicePtr =
object.GetChoiceObject().GetObjectPtr();
1135 _TRACE(
"CObjectIStream::ReadPointer("<<declaredType->
GetName()<<
")");
1140 _TRACE(
"CObjectIStream::ReadPointer: null");
1141 return pair<TObjectPtr, TTypeInfo>((
TObjectPtr)0, declaredType);
1144 _TRACE(
"CObjectIStream::ReadPointer: @...");
1146 _TRACE(
"CObjectIStream::ReadPointer: @" << index);
1148 objectType =
info.GetTypeInfo();
1149 objectPtr =
info.GetObjectPtr();
1152 "invalid reference to skipped object: object ptr is NULL");
1158 _TRACE(
"CObjectIStream::ReadPointer: new");
1165 objectPtr = declaredType->
Create();
1171 return make_pair(objectPtr, declaredType);
1175 _TRACE(
"CObjectIStream::ReadPointer: new...");
1177 _TRACE(
"CObjectIStream::ReadPointer: new " << className);
1178 objectType =
MapType(className);
1188 objectPtr = objectType->
Create();
1206 while ( objectType != declaredType ) {
1213 if ( parentClass ) {
1214 objectType = parentClass;
1220 return make_pair(objectPtr, objectType);
1229 _TRACE(
"CObjectIStream::SkipExternalObject("<<typeInfo->
GetName()<<
")");
1236 _TRACE(
"CObjectIStream::SkipPointer("<<declaredType->
GetName()<<
")");
1239 _TRACE(
"CObjectIStream::SkipPointer: null");
1243 _TRACE(
"CObjectIStream::SkipPointer: @...");
1245 _TRACE(
"CObjectIStream::SkipPointer: @" << index);
1251 _TRACE(
"CObjectIStream::ReadPointer: new");
1258 _TRACE(
"CObjectIStream::ReadPointer: new...");
1260 _TRACE(
"CObjectIStream::ReadPointer: new " << className);
1291 #ifndef VIRTUAL_MID_LEVEL_IO
1296 #ifndef VIRTUAL_MID_LEVEL_IO
1328 bool old_element = containerType->
InitIterator(iter, containerPtr);
1330 if ( old_element ) {
1335 containerType->
AddElement(containerPtr, *
this);
1339 if ( old_element ) {
1550 : m_Stream(
in), m_KnownLength(
false), m_Ended(
false), m_Length(1)
1552 in.BeginBytes(*
this);
1559 GetStream().Unended(
"byte block not fully read");
1570 if ( m_Length == 0 ) {
1571 GetStream().EndBytes(*
this);
1580 if ( KnownLength() ) {
1581 if ( m_Length < needLength )
1584 length = needLength;
1587 if ( m_Length == 0 )
1590 length = needLength;
1593 if ( length == 0 ) {
1594 if ( forceLength && needLength != 0 )
1595 GetStream().ThrowError(
fReadError,
"read fault");
1599 length = GetStream().ReadBytes(*
this,
static_cast<char*
>(dst), length);
1600 if ( KnownLength() )
1602 if ( forceLength && needLength != length )
1603 GetStream().ThrowError(
fReadError,
"read fault");
1613 : m_Stream(
in), m_KnownLength(
false), m_Ended(
false), m_Length(1)
1615 in.BeginChars(*
this);
1622 GetStream().Unended(
"char block not fully read");
1633 if ( m_Length == 0 ) {
1634 GetStream().EndChars(*
this);
1643 if ( KnownLength() ) {
1644 if ( m_Length < needLength )
1647 length = needLength;
1650 if ( m_Length == 0 )
1653 length = needLength;
1656 if ( length == 0 ) {
1657 if ( forceLength && needLength != 0 )
1658 GetStream().ThrowError(
fReadError,
"read fault");
1662 length = GetStream().ReadChars(*
this, dst, length);
1663 if ( KnownLength() )
1665 if ( forceLength && needLength != length )
1666 GetStream().ThrowError(
fReadError,
"read fault");
1736 #if defined(FLT_MIN) && defined(FLT_MAX)
1737 if ( data < FLT_MIN || data > FLT_MAX )
1743 #if SIZEOF_LONG_DOUBLE != 0
1744 long double CObjectIStream::ReadLDouble(
void)
1767 pack_string.
Pack(s);
1820 #if SIZEOF_LONG_DOUBLE != 0
1821 void CObjectIStream::SkipLDouble(
void)
1845 vector<unsigned char> v;
1846 unsigned char buf[2048];
1851 bm::deserialize(obj,
reinterpret_cast<const unsigned char*
>(&v.front()));
1869 message +=
"Bad char [0x" +
1876 message +=
"\n" +
str;
1878 switch (fix_method) {
1908 size_t min_depth)
const
1917 if ( ++
depth > max_depth ) {
1926 #ifdef NCBI_STRICT_GI
Incapsulate compile time information such as __FILE__, __LINE__, NCBI_MODULE, current function.
Read hook for a choice variant (CHOICE)
Read hook for data member of a containing object (eg, SEQUENCE)
Read hook for a standalone object.
T & Get(void)
Create the variable if not created yet, return the reference.
Root class for all serialization exceptions.
Skip hook for a choice variant (CHOICE)
Skip hook for data member of a containing object (eg, SEQUENCE)
Skip hook for a standalone object.
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
CTypeInfo class contains all information about C++ types (both basic and classes): members and layout...
Interface for testing cancellation request in a long lasting operation.
iterator_bool insert(const value_type &val)
Include a standard set of the NCBI C++ Toolkit most basic headers.
static unsigned char depth[2 *(256+1+29)+1]
static const char * str(char *buf, int n)
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
element_type * release(void)
Release will release ownership of pointer to caller.
@ eTakeOwnership
An object can take ownership of another.
#define ERR_POST_X(err_subcode, message)
Error posting with default error code and given error subcode.
#define NCBI_ERRCODE_X
Returns currently set default error code.
@ eDPF_Default
Use global default flags (merge with).
@ eDiag_Trace
Trace message.
@ eDiag_Error
Error message.
@ eDiag_Fatal
Fatal error – guarantees exit(or abort)
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
#define NCBI_RETHROW_SAME(prev_exception, message)
Generic macro to re-throw the same exception.
static const CItemInfo * FindNextMandatory(const CItemInfo *info)
void SetPathReadHook(CObjectIStream *in, const string &path, CReadClassMemberHook *hook)
const CMemberId & GetId(void) const
void SetPathSkipHook(CObjectIStream *in, const string &path, CSkipChoiceVariantHook *hook)
void SetPathReadHook(CObjectIStream *in, const string &path, CReadChoiceVariantHook *hook)
void ReadVariant(CObjectIStream &in, TObjectPtr choicePtr) const
void SkipVariant(CObjectIStream &in) const
bool HaveNoPrefix(void) const
void DefaultReadVariant(CObjectIStream &in, TObjectPtr choicePtr) const
void DefaultReadMember(CObjectIStream &in, TObjectPtr classPtr) const
void SetPathSkipHook(CObjectIStream *in, const string &path, CSkipClassMemberHook *hook)
string ToString(void) const
ESerialSkipUnknown
Skip unknown members parameters.
EFixNonPrint
How to process non-printing character in the ASN VisibleString.
size_t TMemberIndex
Type used for indexing class members and choice variants.
const TMemberIndex kInvalidMember
Special value returned from FindMember.
ESerialVerifyData
Data verification parameters.
#define XSERIAL_TYPEINFO_WRITELOCK
static const TObjectType * SafeCast(TTypeInfo type)
ESerialDataFormat
Data file format.
#define SERIAL_VERIFY_DATA_READ
@ eSerial_StdWhenStd
use std when filename is "stdin"/"stdout"
@ eSerial_StdWhenDash
use std stream when filename is "-"
@ eSerial_StdWhenEmpty
use std stream when filename is empty
@ eSerial_UseFileForReread
@ eSerialSkipUnknown_Never
never skip (even if set to skip later on)
@ eSerialSkipUnknown_No
do not skip (throw exception)
@ eSerialSkipUnknown_Yes
do skip
@ eSerialSkipUnknown_Always
always skip (even if set not to later on)
@ eSerialSkipUnknown_Default
use current default
@ eFNP_Allow
pass through unchanged, post no error message
@ eFNP_Skip
skip, post no error message
@ eFNP_Throw
replace with '#', throw an exception
@ eFNP_Abort
replace with '#', post an error of severity FATAL
@ eFNP_ReplaceAndWarn
replace with '#', post an error of severity ERROR
@ eFNP_Replace
replace with '#' silently
@ eSerialVerifyData_Never
never verify (even if set to verify later on)
@ eSerialVerifyData_DefValueAlways
initialize field with default
@ eSerialVerifyData_DefValue
initialize field with default
@ eSerialVerifyData_Yes
do verify
@ eSerialVerifyData_Always
always verify (even if set not to later on)
@ eSerialVerifyData_No
do not verify
@ eSerialVerifyData_Default
use current default
@ eSerial_AsnText
ASN.1 text.
@ eSerial_AsnBinary
ASN.1 binary.
ESerialDataFormat GetDataFormat(void) const
Get data format.
void SetPathSkipMemberHook(const string &path, CSkipClassMemberHook *hook)
void ThrowError1(const CDiagCompileInfo &diag_info, TFailFlags fail, const char *message)
virtual void ReadStringStore(string &s)
static CTypeInfo * FindType(const CObjectStack &stk)
virtual void SkipGi(void)
vector< TTypeInfo > m_ReqMonitorType
void SetCanceledCallback(const ICanceled *callback)
Set cancellation check callback.
static ESerialSkipUnknown x_GetSkipUnknownVariantsDefault(void)
virtual void ReadString(string &s, EStringType type=eStringTypeVisible)=0
virtual EPointerType ReadPointerType(void)=0
CStreamPathHook< CMemberInfo *, CSkipClassMemberHook * > m_PathSkipMemberHooks
virtual void ReadGi(TGi &obj)
ESerialVerifyData GetVerifyData(void) const
Get input data verification parameter.
char ReplaceVisibleChar(char c, EFixNonPrint fix_method, const CObjectStack *io, const CTempString &str, char subst)
void Read(const CObjectInfo &object)
Read object of know type.
CharBlock(CObjectIStream &in)
virtual void x_SetPathHooks(bool set) override
ByteBlock(CObjectIStream &in)
virtual void EndClassMember(void)
MLIOVIR void ReadAlias(const CAliasTypeInfo *aliasType, TObjectPtr aliasPtr)
void SkipFileHeader(TTypeInfo typeInfo)
Read file header and compare the type name with the expected one.
virtual void Location(string &, size_t &) const
Get current stream location as tuple (positiontype:string, size_t).
EDelayBufferParsing GetDelayBufferParsingPolicy(void) const
virtual set< TTypeInfo > GuessDataType(const set< TTypeInfo > &known_types, size_t max_length=16, size_t max_bytes=1024 *1024)
Identify the type of data in the stream.
virtual void SkipInt4(void)
void SetHook(const string &path, THook hook)
MLIOVIR void ReadClassSequential(const CClassTypeInfo *classType, TObjectPtr classPtr)
static CObjectIStream * CreateObjectIStreamXml(void)
CLocalHookSet< CSkipObjectHook > m_ObjectSkipHookKey
virtual void EndContainerElement(void)
static void SetSkipUnknownGlobal(ESerialSkipUnknown skip)
Set up default skipping unknown members for streams created by the current process.
MLIOVIR void SkipChoiceSimple(const CChoiceTypeInfo *choiceType)
virtual Int1 ReadInt1(void)
#define BEGIN_OBJECT_FRAME(Type)
virtual void UndoClassMember(void)
#define ThrowError(flag, mess)
virtual void EndContainer(void)=0
bool fail(void) const
Check if any of fail flags is set.
void RegisterObject(TTypeInfo typeInfo)
ESerialSkipUnknown UpdateSkipUnknownMembers(void)
Update skip unknown members option to non-default value.
bool HasTypeInfo(void) const
const CReadObjectInfo & GetRegisteredObject(TObjectIndex index) const
virtual void EndBytes(const ByteBlock &block)
void ResetPathHooks(void)
static CObjectIStream * Create(ESerialDataFormat format)
Create serial object reader.
CStreamObjectPathHook< CSkipObjectHook * > m_PathSkipObjectHooks
EFixNonPrint x_GetFixCharsMethodDefault(void) const
virtual bool EndOfData(void)
Check if there is still some meaningful data that can be read; in text streams this function will ski...
virtual void SkipInt1(void)
virtual TMemberIndex BeginClassMember(const CClassTypeInfo *classType)=0
CStreamObjectPathHook< CReadObjectHook * > m_PathReadObjectHooks
void SetMonitorType(TTypeInfo type)
void AddMonitorType(TTypeInfo type)
virtual Uint1 ReadUint1(void)
virtual string ReadOtherPointer(void)=0
virtual void SkipString(EStringType type=eStringTypeVisible)=0
const CMemberInfo * GetMemberInfo(void) const
#define BEGIN_OBJECT_FRAME2(Type, Arg)
static CObjectIStream * CreateObjectIStreamAsn(void)
MLIOVIR void ReadContainer(const CContainerTypeInfo *containerType, TObjectPtr containerPtr)
virtual string GetStackTrace(void) const =0
void Unended(const string &msg)
const CReadObjectInfo & GetRegisteredObject(TObjectIndex index)
void SkipObject(const CObjectTypeInfo &objectType)
Skip child object.
virtual void SkipFNumber(void)=0
virtual void ReadOtherPointerEnd(void)
CStreamPathHook< CVariantInfo *, CReadChoiceVariantHook * > m_PathReadVariantHooks
static ESerialVerifyData x_GetVerifyDataDefault(void)
const string & GetStackPath(void) const
MLIOVIR void SkipAlias(const CAliasTypeInfo *aliasType)
TObjectPtr GetObjectPtr(void) const
Get pointer to object.
virtual void BeginNamedType(TTypeInfo namedTypeInfo)
TFlags GetFlags(void) const
virtual double ReadDouble(void)=0
virtual string ReadFileHeader(void)
Read file header.
CObjectInfo ReadObject(void)
virtual void ResetState(void) override
void ReadChoiceVariant(const CObjectInfoCV &object)
const CObjectInfo & GetClassObject(void) const
Get containing class data.
virtual Uint2 ReadUint2(void)
bool ExpectedMember(const CMemberInfo *memberInfo)
virtual string GetStackTrace(void) const override
Get current stack trace as string.
void ResetLocalHooks(void)
TFrame & FetchFrameFromTop(size_t index)
void SetStreamPos(CNcbiStreampos pos)
Set the current read position in underlying input stream This is the same as istream::seekg()
TObjectIndex GetObjectCount(void) const
virtual void EndNamedType(void)
virtual TMemberIndex BeginChoiceVariant(const CChoiceTypeInfo *choiceType)=0
static void SetSkipUnknownVariantsGlobal(ESerialSkipUnknown skip)
Set up default skipping unknown choice variants for streams created by the current process.
string GetStackTraceASN(void) const
virtual void SkipSNumber(void)=0
void Skip(const CObjectTypeInfo &type)
Skip object of know type.
ESerialSkipUnknown UpdateSkipUnknownVariants(void)
Update skip unknown variants option to non-default value.
CLocalHookSet< CReadObjectHook > m_ObjectHookKey
void SetPathReadMemberHook(const string &path, CReadClassMemberHook *hook)
virtual void BeginContainer(const CContainerTypeInfo *containerType)=0
virtual void SkipUNumber(void)=0
void ResetMonitorType(void)
AutoPtr< CReadObjectList > m_Objects
virtual Uint4 ReadUint4(void)
virtual char * ReadCString(void)
CNcbiStreampos GetStreamPos(void) const
Get the current stream position.
bool ShouldParseDelayBuffer(void) const
TTypeInfo GetTypeInfo(void) const
virtual void UnendedFrame(void) override
virtual void SkipUint8(void)
virtual void SkipAnyContentVariant(void)
CLocalHookSet< CReadClassMemberHook > m_ClassMemberHookKey
void SetMemoryPool(CObjectMemoryPool *memory_pool)
virtual void SkipStringStore(void)
virtual Int2 ReadInt2(void)
virtual string GetPosition(void) const override
Get current stream position as string.
#define END_OBJECT_FRAME()
virtual void SkipCString(void)
void SetPathSkipVariantHook(const string &path, CSkipChoiceVariantHook *hook)
size_t GetStackDepth(void) const
static CObjectIStream * Open(ESerialDataFormat format, CNcbiIstream &inStream, bool deleteInStream)
Create serial object reader and attach it to an input stream.
bool InGoodState(void)
Check fail flags and also the state of input data source.
virtual void ReadPackedString(string &s, CPackString &pack_string, EStringType type=eStringTypeVisible)
TConstObjectPtr GetObjectPtr(void) const
void ReadClassMember(const CObjectInfoMI &member)
static ESerialSkipUnknown x_GetSkipUnknownDefault(void)
void ForgetObjects(TObjectIndex from, TObjectIndex to)
virtual string PeekNextTypeName(void)
Peek next data type name in XML stream.
const TFrame & TopFrame(void) const
virtual float ReadFloat(void)
static CRef< CByteSource > GetSource(ESerialDataFormat format, const string &fileName, TSerialOpenFlags openFlags=0)
ESerialSkipUnknown m_SkipUnknown
static void SetSkipUnknownThread(ESerialSkipUnknown skip)
Set up default skipping unknown members for streams created by the current thread.
virtual void SkipPointer(TTypeInfo declaredType)
void UnsetMemberSpecialCase(void)
ESerialSkipUnknown m_SkipUnknownVariants
TObjectPtr GetParentObjectPtr(TTypeInfo type, size_t max_depth=1, size_t min_depth=1) const
EDelayBufferParsing
DelayBuffer parsing policy.
CStreamPathHook< CMemberInfo *, CReadClassMemberHook * > m_PathReadMemberHooks
EFixNonPrint x_FixCharsMethod(void) const
bool x_HavePathHooks() const
THook GetHook(CObjectStack &stk) const
TFailFlags SetFailFlags(TFailFlags flags, const char *message=0)
Set fail flags.
MLIOVIR void ReadChoiceSimple(const CChoiceTypeInfo *choiceType, TObjectPtr choicePtr)
virtual pair< TObjectPtr, TTypeInfo > ReadPointer(TTypeInfo declaredType)
void SetHook(const string &path, THook hook)
void SetTopMemberId(const CMemberId &memberId)
TFailFlags GetFailFlags(void) const
Get fail flags.
void SetPathSkipObjectHook(const string &path, CSkipObjectHook *hook)
void RegisterObject(TTypeInfo typeInfo)
void ReadExternalObject(TObjectPtr object, TTypeInfo typeInfo)
void SetPathReadVariantHook(const string &path, CReadChoiceVariantHook *hook)
MLIOVIR void ReadNamedType(TTypeInfo namedTypeInfo, TTypeInfo typeInfo, TObjectPtr object)
void SkipExternalObject(TTypeInfo typeInfo)
virtual bool BeginContainerElement(TTypeInfo elementType)=0
virtual void ResetState(void)
virtual Int8 ReadInt8(void)=0
virtual TObjectIndex ReadObjectPointer(void)=0
void WatchPathHooks(bool set=true)
MLIOVIR void SkipContainer(const CContainerTypeInfo *containerType)
MLIOVIR void SkipClassSequential(const CClassTypeInfo *classType)
virtual Int4 ReadInt4(void)
CStreamPathHook< CVariantInfo *, CSkipChoiceVariantHook * > m_PathSkipVariantHooks
static TInfo FindItem(const CObjectStack &stk)
virtual void SkipUint2(void)
virtual void SkipAnyContentObject(void)=0
void SetPathReadObjectHook(const string &path, CReadObjectHook *hook)
static CObjectIStream * CreateFromBuffer(ESerialDataFormat format, const char *buffer, size_t size)
Create serial object reader and attach it to a data source.
static CObjectIStream * CreateObjectIStreamAsnBinary(void)
EFrameType GetFrameType(void) const
virtual void SkipInt2(void)
void ReadSeparateObject(const CObjectInfo &object)
Temporary reader.
virtual Uint8 ReadUint8(void)=0
static void SetVerifyDataThread(ESerialVerifyData verify)
Set up default input data verification for streams created by the current thread.
void Close(void)
Detach reader from a data source.
void SetStreamOffset(CNcbiStreampos pos)
CLocalHookSet< CSkipClassMemberHook > m_ClassMemberSkipHookKey
CLocalHookSet< CSkipChoiceVariantHook > m_ChoiceVariantSkipHookKey
static CObjectIStream * CreateObjectIStreamJson(void)
void SetDelayBufferParsingPolicy(EDelayBufferParsing policy)
#define BEGIN_OBJECT_FRAME3(Type, Arg1, Arg2)
virtual void SkipFloat(void)
virtual void EndClass(void)
virtual void StartDelayBuffer(void)
virtual void SkipDouble(void)
virtual void EndChoiceVariant(void)
virtual void BeginClass(const CClassTypeInfo *classInfo)=0
virtual ~CObjectIStream(void)
Destructor.
CObjectMemoryPool * GetMemoryPool(void)
void HandleEOF(CEofException &)
virtual void EndChars(const CharBlock &block)
void DuplicatedMember(const CMemberInfo *memberInfo)
virtual void SkipInt8(void)
virtual void SkipUint4(void)
THook GetHook(CObjectStack &stk) const
CLocalHookSet< CReadChoiceVariantHook > m_ChoiceVariantHookKey
void OpenFromBuffer(const char *buffer, size_t size)
Attach reader to a data source.
CObjectIStream(ESerialDataFormat format)
virtual void EndChoice(void)
MLIOVIR void SkipClassRandom(const CClassTypeInfo *classType)
virtual void SkipUint1(void)
static void SetSkipUnknownVariantsThread(ESerialSkipUnknown skip)
Set up default skipping unknown choice variants for streams created by the current thread.
CNcbiStreampos GetStreamOffset(void) const
MLIOVIR void SkipNamedType(TTypeInfo namedTypeInfo, TTypeInfo typeInfo)
virtual CRef< CByteSource > EndDelayBuffer(void)
void ReadCompressedBitString(CBitString &data)
static void SetVerifyDataGlobal(ESerialVerifyData verify)
Set up default input data verification for streams created by the current process.
virtual void BeginChoice(const CChoiceTypeInfo *choiceType)
MLIOVIR void ReadClassRandom(const CClassTypeInfo *classType, TObjectPtr classPtr)
virtual void EndOfRead(void)
size_t Read(char *dst, size_t length, bool forceLength=false)
size_t Read(void *dst, size_t length, bool forceLength=false)
virtual string GetPosition(void) const =0
EDelayBufferParsing m_ParseDelayBuffers
@ fEOF
End of file in the middle of reading an object.
@ fOverflow
Data read is beyond the allowed limits.
@ fNullValue
Input value is 'null'.
@ fReadError
An unknown error when reading the input file.
@ fIllegalCall
Illegal in a given context function call.
@ fNotImplemented
Method is not implemented.
@ fMissingValue
Mandatory value was missing in the input.
@ fInvalidData
Input data is incorrect (e.g. invalid enum)
@ fFail
Internal error, the real reason is unclear.
@ fFormatError
Input file formatting does not conform with specification.
@ eDelayBufferPolicyNotSet
Parse only if local hook are present.
@ eDelayBufferPolicyAlwaysParse
Parse always.
@ eFormatError
Malformed input data.
@ eIoError
An unknown error during serialization.
@ eInvalidData
Data is incorrect.
@ eMissingValue
Mandatory value was missing in the input.
@ eOverflow
Data is beyond the allowed limits.
@ eNotOpen
No input or output file.
@ eNullValue
Data value is null.
@ eFail
Internal error, the real reason is unclear.
@ eEOF
Unexpected end-of-file.
@ eNotImplemented
Attempt to use unimplemented funtionality.
@ eIllegalCall
Illegal in a given context function call.
void Reset(void)
Reset reference object.
TObjectType * Release(void)
Release a reference to the object and return a pointer to the object.
@ eParam_NoThread
Do not use per-thread values.
uint8_t Uint1
1-byte (8-bit) unsigned integer
int16_t Int2
2-byte (16-bit) signed integer
int32_t Int4
4-byte (32-bit) signed integer
uint32_t Uint4
4-byte (32-bit) unsigned integer
uint16_t Uint2
2-byte (16-bit) unsigned integer
int64_t Int8
8-byte (64-bit) signed integer
uint64_t Uint8
8-byte (64-bit) unsigned integer
int8_t Int1
1-byte (8-bit) signed integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
char PeekChar(size_t offset=0)
void ResetBufferLock(size_t pos)
void Open(CByteSourceReader &reader)
bool EndOfData(void) const
void StartSubSource(void)
void SetStreamPos(CNcbiStreampos pos)
CNcbiStreampos GetStreamPos(void) const
void SetCanceledCallback(const ICanceled *callback)
size_t SetBufferLock(size_t size)
const char * GetError(void) const
CRef< CByteSource > EndSubSource(void)
Int8 NcbiStreamposToInt8(NCBI_NS_STD::char_traits< char >::pos_type stream_pos)
Convert stream position to 64-bit int.
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
IO_PREFIX::streampos CNcbiStreampos
Portable alias for streampos.
static string Int8ToString(Int8 value, TNumToStringFlags flags=0, int base=10)
Convert Int8 to string.
static int CompareNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive compare of a substring with another string.
static void PtrToString(string &out_str, const void *ptr)
Convert pointer to string.
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
const string & GetName(void) const
Get name of this type.
ETypeFamily GetTypeFamily(void) const
TObjectPtr AddElement(TObjectPtr containerPtr, TConstObjectPtr elementPtr, ESerialRecursionMode how=eRecursive) const
TTypeInfo GetPointedType(void) const
const CMemberInfo * GetMemberInfo(TMemberIndex index) const
static TTypeInfo GetClassInfoByName(const string &name)
bool IsCObject(void) const
Check is this TypeInfo object is kind of CClassTypeInfoBase.
const CVariantInfo * GetVariantInfo(TMemberIndex index) const
void ReadData(CObjectIStream &in, TObjectPtr object) const
TObjectPtr GetDataPtr(TObjectPtr objectPtr) const
TConstObjectPtr GetElementPtr(const CConstIterator &it) const
void SetPathReadHook(CObjectIStream *in, const string &path, CReadObjectHook *hook)
Set local context-specific read hook.
bool InitIterator(CConstIterator &it, TConstObjectPtr containerPtr) const
bool NextElement(CConstIterator &it) const
void EraseAllElements(CIterator &it) const
void SetPathSkipHook(CObjectIStream *in, const string &path, CSkipObjectHook *hook)
Set local context-specific skip hook.
bool IsFullAlias(void) const
TTypeInfo GetElementType(void) const
TObjectPtr Create(CObjectMemoryPool *memoryPool=0) const
Create object of this type on heap (can be deleted by operator delete)
enum ENcbiOwnership EOwnership
Ownership relations between objects.
size_t deserialize(BV &bv, const unsigned char *buf, bm::word_t *temp_block=0, const bm::bv_ref_vector< BV > *ref_vect=0)
Bitvector deserialization from a memory BLOB.
#define ErrCode()
Get the error code for the last failed system function.
Definition of all error codes used in serial libraries (xser.lib, xcser.lib).
const struct ncbi::grid::netcache::search::fields::SIZE size
const CharType(& source)[N]
Defines MS Windows specifics for our "C++" code.
Static variables safety - create on demand, destroy on application termination.
Multi-threading – mutexes; rw-locks; semaphore.
Multi-threading – classes, functions, and features.
Useful/utility classes and methods.
std::istream & in(std::istream &in_, double &x_)
NCBI_PARAM_ENUM_DECL(ESerialVerifyData, SERIAL, VERIFY_DATA_READ)
NCBI_PARAM_ENUM_DEF(ESerialVerifyData, SERIAL, VERIFY_DATA_READ, eSerialVerifyData_Default)
typedef NCBI_PARAM_TYPE(SERIAL, VERIFY_DATA_READ) TSerialVerifyData
NCBI_PARAM_DECL(bool, SERIAL, READ_MMAPBYTESOURCE)
NCBI_PARAM_DEF_EX(bool, SERIAL, READ_MMAPBYTESOURCE, false, eParam_NoThread, SERIAL_READ_MMAPBYTESOURCE)
NCBI_PARAM_ENUM_ARRAY(ESerialVerifyData, SERIAL, VERIFY_DATA_READ)
static TTypeInfo MapType(const string &name)
ESerialSkipUnknownMembers
@ eSerialSkipUnknownM_Yes
@ eSerialSkipUnknownM_Always
@ eSerialSkipUnknownM_Never
@ eSerialSkipUnknownM_Default
#define SkipClassSequentialContentsEnd()
#define SkipClassRandomContentsMember()
#define ReadClassSequentialContentsEnd(classPtr)
#define SkipClassSequentialContentsBegin(classType)
#define ReadClassRandomContentsBegin(classType)
#define ReadClassSequentialContentsMember(classPtr)
#define ReadClassSequentialContentsBegin(classType)
#define ReadClassRandomContentsMember(classPtr)
#define SkipClassSequentialContentsMember()
#define SkipClassRandomContentsEnd()
#define SkipClassRandomContentsBegin(classType)
#define ReadClassRandomContentsEnd()
#define VIRTUAL_MID_LEVEL_IO
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
#define NcbiSysChar_strdup