1 #ifndef OBJECTITER__HPP
2 #define OBJECTITER__HPP
80 return m_Iterator.GetIndex();
106 return m_Iterator.GetElementCount();
149 return m_Iterator.GetIndex();
210 return GetItemIndex();
275 void ResetGlobalReadHook(
void)
const;
283 void ResetGlobalWriteHook(
void)
const;
297 void ResetGlobalCopyHook(
void)
const;
350 void ResetGlobalReadHook(
void)
const;
358 void ResetGlobalWriteHook(
void)
const;
372 void ResetGlobalCopyHook(
void)
const;
417 bool CanGet(
void)
const;
419 pair<TConstObjectPtr, TTypeInfo> GetMemberPair(
void)
const;
458 void Erase(EEraseFlag flag = eErase_Optional);
462 bool CanGet(
void)
const;
464 pair<TObjectPtr, TTypeInfo> GetMemberPair(
void)
const;
511 void ResetGlobalReadHook(
void)
const;
519 void ResetGlobalWriteHook(
void)
const;
527 void ResetGlobalCopyHook(
void)
const;
575 pair<TConstObjectPtr, TTypeInfo> GetVariantPair(
void)
const;
606 pair<TObjectPtr, TTypeInfo> GetVariantPair(
void)
const;
612 template <
typename TObj>
614 typename TObj::TmemberIndex mi;
615 mi.TObj::TmemberIndex::Tparent::reset();
618 bool allmandatory =
true;
621 if ( member.IsSet()) {
622 mi.TObj::TmemberIndex::Tparent::set(
i);
623 }
else if (!member.GetItemInfo()->Optional()) {
624 allmandatory =
false;
627 mi.TObj::TmemberIndex::Tparent::set(
kInvalidMember, allmandatory);
634 template <
typename TObj>
638 bool allmandatory = mi.TObj::TmemberIndex::Tparent::test(0);
641 if ((allmandatory && !member.GetItemInfo()->Optional()) ||
642 mi.TObj::TmemberIndex::Tparent::test(
i)) {
Copy hook for a choice variant (CHOICE)
Copy hook for data member of a containing object (eg, SEQUENCE)
Read hook for a choice variant (CHOICE)
Read hook for data member of a containing object (eg, SEQUENCE)
Skip hook for a choice variant (CHOICE)
Skip hook for data member of a containing object (eg, SEQUENCE)
Write hook for a choice variant (CHOICE)
Write hook for data member of a containing object (eg, SEQUENCE)
Include a standard set of the NCBI C++ Toolkit most basic headers.
size_t TMemberIndex
Type used for indexing class members and choice variants.
const TMemberIndex kFirstMemberIndex
Start if member indexing.
const TMemberIndex kInvalidMember
Special value returned from FindMember.
void Init(const CObjectTypeInfo &info, TMemberIndex index)
CObjectTypeInfoII CParent
const string & GetAlias(void) const
void Init(const CObjectTypeInfo &info, TMemberIndex index)
const CConstObjectInfo & GetChoiceObject(void) const
Get containing choice.
DECLARE_OPERATOR_BOOL(Valid())
Is iterator valid.
bool Valid(void) const
Is iterator valid.
CObjectTypeInfo m_OwnerType
CConstObjectInfoMI(const CConstObjectInfo &object, TMemberIndex index)
CObjectTypeInfoMI CParent
CConstObjectInfo operator*(void) const
Get class member data.
TMemberIndex GetVariantIndex(void) const
Get index of the variant in the choice.
const CClassTypeInfoBase * GetClassTypeInfoBase(void) const
void Reset(void)
Reset value of member to default state.
const CObjectInfo & GetChoiceObject(void) const
Get containing choice.
CObjectInfo operator*(void) const
Get variant data.
TObj::TmemberIndex Serial_GetAssignedMembers(TObj &obj)
CConstObjectInfoEI & operator++(void)
Advance to next element.
bool Valid(void) const
Is iterator valid.
bool operator==(const CConstObjectInfoEI &obj) const
CObjectTypeInfoMI CParent
CObjectTypeInfo GetVariantType(void) const
Get variant data type.
CVariantInfo * GetNCVariantInfo(void) const
TMemberIndex GetMemberIndex(void) const
Get index of the member in the class.
CObjectTypeInfo GetChoiceType(void) const
Get containing choice type.
CObjectTypeInfo operator*(void) const
Get variant data type.
size_t GetElementCount(void) const
void Serial_ResetMembers(TObj &obj, typename TObj::TmemberIndex &mi)
CObjectTypeInfoMI(const CObjectTypeInfo &info, TMemberIndex index)
CObjectTypeInfoII CParent
CObjectTypeInfoMI & operator++(void)
Advance to next element.
void Init(const CClassTypeInfoBase *typeInfo)
CVariantInfo * GetNCVariantInfo(void) const
CObjectInfo GetElement(void) const
Get element data and type information.
CObjectInfoMI & operator=(const CObjectInfo &object)
CObjectTypeInfoVI(const CObjectTypeInfo &info, TMemberIndex index)
TMemberIndex GetItemIndex(void) const
CObjectInfoCV & operator=(const CObjectInfo &object)
const CMemberInfo * GetMemberInfo(void) const
CConstObjectInfo m_Object
TMemberIndex m_VariantIndex
void Next(void)
Advance to next element.
CObjectTypeInfo GetMemberType(void) const
Get data type information.
CObjectTypeInfoVI & operator=(const CObjectTypeInfo &info)
CMemberIterator BeginMembers(void) const
Create class member iterator.
TMemberIndex m_LastItemIndex
const CItemInfo * GetItemInfo(void) const
DECLARE_OPERATOR_BOOL(Valid())
CObjectTypeInfoCV & operator=(const CConstObjectInfo &object)
CObjectInfo GetMember(void) const
Get class member data.
bool IsSet(void) const
Is member assigned a value.
void Init(const CObjectTypeInfo &info)
const CObjectInfo & GetClassObject(void) const
Get containing class data.
TMemberIndex GetCurrentChoiceVariantIndex(void) const
Get index of currently selected choice variant.
CObjectTypeInfoVI(const CObjectTypeInfo &info)
CObjectTypeInfoCV CParent
CObjectTypeInfoCV(const CObjectTypeInfo &info)
const CConstObjectInfo & GetClassObject(void) const
Get containing class data.
CObjectTypeInfoMI(const CObjectTypeInfo &info)
CConstContainerElementIterator m_Iterator
void Init(const CObjectTypeInfo &info, TMemberIndex index)
void Next(void)
Advance to next element.
CObjectTypeInfo GetClassType(void) const
Get containing class type.
const CChoiceTypeInfo * GetChoiceTypeInfo(void) const
bool CheckValid(void) const
bool operator!=(const CConstObjectInfoEI &obj) const
bool operator!=(const CObjectTypeInfoII &iter) const
CObjectTypeInfo operator*(void) const
Get data type information.
CObjectInfoEI & operator++(void)
Advance to next element.
void Init(const CObjectTypeInfo &info)
CConstObjectInfoCV(const CConstObjectInfo &object, TMemberIndex index)
CConstObjectInfo operator*(void) const
Get variant data.
CObjectInfoCV(const CObjectInfo &object, TMemberIndex index)
CObjectTypeInfoCV CParent
CConstObjectInfoMI & operator=(const CConstObjectInfo &object)
CObjectTypeInfo GetChoiceType(void) const
Get containing choice.
void Init(const CClassTypeInfoBase *typeInfo, TMemberIndex index)
const CItemInfo * GetItemInfo(void) const
CObjectInfo GetVariant(void) const
Get variant data.
bool Valid(void) const
Is iterator valid.
const CObjectTypeInfo & GetOwnerType(void) const
bool operator==(const CObjectTypeInfoII &iter) const
CConstObjectInfo operator*(void) const
Get element data and type information.
CConstObjectInfo GetVariant(void) const
Get variant data.
TMemberIndex GetIndex(void) const
Get index of the element in the container.
CObjectTypeInfo operator*(void) const
Get data type information.
CObjectInfoMI(const CObjectInfo &object)
CObjectTypeInfoCV(const CObjectTypeInfo &info, TMemberIndex index)
CConstObjectInfo GetMember(void) const
Get class member data.
TMemberIndex GetVariantIndex(void) const
Get index of the variant in the choice.
const CChoiceTypeInfo * m_ChoiceTypeInfo
CObjectInfo operator*(void) const
Get class member data.
CObjectTypeInfoVI & operator++(void)
Advance to next element.
CMemberIterator BeginMembers(void) const
Create class member iterator.
CConstObjectInfoMI(const CConstObjectInfo &object)
CObjectTypeInfoII(const CClassTypeInfoBase *typeInfo)
ETypeFamily GetTypeFamily(void) const
Get data type family.
CObjectTypeInfoCV & operator=(const CObjectTypeInfo &info)
CConstObjectInfoCV & operator=(const CConstObjectInfo &object)
CConstObjectInfo m_Object
void Next(void)
Advance to next element.
const CChoiceTypeInfo * GetChoiceTypeInfo(void) const
bool operator!=(const CObjectTypeInfoCV &iter) const
DECLARE_OPERATOR_BOOL(Valid())
Is iterator valid.
TMemberIndex GetIndex(void) const
Get index of the element in the container (class or choice)
CMemberInfo * GetNCMemberInfo(void) const
bool CheckValid(void) const
CObjectTypeInfoCV(const CConstObjectInfo &object)
TMemberIndex GetIndex(void) const
Get index of the element in the container.
bool CheckValid(void) const
DECLARE_OPERATOR_BOOL(Valid())
Is iterator valid.
CObjectTypeInfo GetVariantType(void) const
Get data type information.
const CClassTypeInfo * GetClassTypeInfo(void) const
CContainerElementIterator m_Iterator
CObjectInfo operator*(void) const
Get element data and type information.
CConstObjectInfoCV(const CConstObjectInfo &object)
bool operator!=(const CObjectInfoEI &obj) const
const CVariantInfo * GetVariantInfo(void) const
const string & GetAlias(void) const
CObjectTypeInfoMI & operator=(const CObjectTypeInfo &info)
CObjectTypeInfoII(const CClassTypeInfoBase *typeInfo, TMemberIndex index)
CObjectInfoMI(const CObjectInfo &object, TMemberIndex index)
const CVariantInfo * GetVariantInfo(void) const
bool IsSet(void) const
Is member assigned a value.
bool operator==(const CObjectTypeInfoCV &iter) const
const CItemInfo * GetItemInfo(void) const
CConstObjectInfo GetElement(void) const
Get element data and type information.
CObjectInfoCV(const CObjectInfo &object)
void Init(const CObjectTypeInfo &info)
bool operator==(const CObjectInfoEI &obj) const
@ eErase_Mandatory
allow erasing mandatory members, may be dangerous!
@ eErase_Optional
default - erase optional member only
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define NCBI_XSERIAL_EXPORT
std::istream & in(std::istream &in_, double &x_)
void SetLocalCopyHook(const CObjectTypeInfo &obj_type_info, CObjectStreamCopier &copier, _Func _func)
void SetLocalSkipHook(const CObjectTypeInfo &obj_type_info, CObjectIStream &istr, _Func _func)
void SetLocalWriteHook(const CObjectTypeInfo &obj_type_info, CObjectOStream &ostr, _Func _func)
void SetLocalReadHook(const CObjectTypeInfo &obj_type_info, CObjectIStream &ostr, _Func _func)