16 TAttr() : AttrNameToId(), AttrIdToName(), IntAttrVals(),
17 FltAttrVals(), StrAttrVals() { }
18 TAttr(
const TAttr& Attrs) : AttrNameToId(Attrs.AttrNameToId),
19 AttrIdToName(Attrs.AttrIdToName), IntAttrVals(Attrs.IntAttrVals),
20 FltAttrVals(Attrs.FltAttrVals), StrAttrVals(Attrs.StrAttrVals) { }
22 TAttr(
TSIn& SIn) : AttrNameToId(SIn), AttrIdToName(SIn),
23 IntAttrVals(SIn), FltAttrVals(SIn), StrAttrVals(SIn) { }
26 AttrNameToId.
Load(SIn);
27 AttrIdToName.
Load(SIn);
28 IntAttrVals.
Load(SIn);
29 FltAttrVals.
Load(SIn);
30 StrAttrVals.
Load(SIn);
34 AttrNameToId.
Save(SOut); AttrIdToName.
Save(SOut);
35 IntAttrVals.
Save(SOut); FltAttrVals.
Save(SOut); StrAttrVals.
Save(SOut); }
37 void Clr() { AttrNameToId.
Clr(); AttrIdToName.
Clr(); IntAttrVals.
Clr(); FltAttrVals.
Clr(); StrAttrVals.
Clr(); }
109 TAttrPair() : AttrNameToId(), AttrIdToName(), IntAttrVals(),
110 FltAttrVals(), StrAttrVals() { }
112 AttrIdToName(Attrs.AttrIdToName), IntAttrVals(Attrs.IntAttrVals),
113 FltAttrVals(Attrs.FltAttrVals), StrAttrVals(Attrs.StrAttrVals) { }
116 IntAttrVals(SIn), FltAttrVals(SIn), StrAttrVals(SIn) { }
119 AttrNameToId.
Save(SOut); AttrIdToName.
Save(SOut);
120 IntAttrVals.
Save(SOut); FltAttrVals.
Save(SOut); StrAttrVals.
Save(SOut); }
122 void Clr() { AttrNameToId.
Clr(); AttrIdToName.
Clr(); IntAttrVals.
Clr(); FltAttrVals.
Clr(); StrAttrVals.
Clr(); }
int DelSAttrDat(const TInt &Id, const TStr &AttrName)
Delete attribute with name AttrName for the given id Id.
int GetSAttrDat(const TIntPr &Id, const TStr &AttrName, TInt &ValX) const
Get Int attribute with name AttrName for the given id Id.
enum TAttrType_ TAttrType
Types for tables, sparse and dense attributes.
int AddSAttrDat(const TInt &Id, const TStr &AttrName, const TInt &Val)
Add Int attribute with name AttrName for the given id Id.
void DelSAttrId(const TIntPr &Id)
Delete all attributes for the given id Id.
int GetSAttrName(const TInt &AttrId, TStr &NameX, TAttrType &AttrTypeX) const
Given the attribute id AttrId, get the attribute name.
void Save(TSOut &SOut) const
TIntIntStrPrH AttrIdToName
int GetSAttrName(const TInt &AttrId, TStr &NameX, TAttrType &AttrTypeX) const
Given the attribute id AttrId, get the attribute name and type.
void DelSAttrId(const TInt &Id)
Delete all attributes for the given id Id.
TAttr(const TAttr &Attrs)
TIntIntPrPrIntH IntAttrVals
TAttrPair(TSIn &SIn)
Constructor for loading attributes from a (binary) stream SIn.
void Save(TSOut &SOut) const
Saves the attributes to a (binary) stream SOut.
size_t GetMemUsed() const
Returns the amount of memory used by sparse attributes.
TIntIntStrPrH AttrIdToName
::TSize GetMemUsed() const
int GetIdVSAttr(const TInt &AttrId, const TAttrType Type, TIntV &IdV) const
TPair< TStr, TAttrType > TAttrPr
TIntIntPrPrFltH FltAttrVals
void GetSAttrV(const TInt &Id, const TAttrType AttrType, TAttrPrV &AttrV) const
Get a list of all attributes of type AttrType for the given id Id.
TIntIntPrPrStrH StrAttrVals
int GetSAttrId(const TStr &Name, TInt &AttrIdX, TAttrType &AttrTypeX) const
Given the attribute name Name, get the attribute id and type.
int GetIdVSAttr(const TInt &AttrId, const TAttrType Type, TIntPrV &IdV) const
int GetSAttrDat(const TInt &Id, const TStr &AttrName, TInt &ValX) const
Get Int attribute with name AttrName for the given id Id.
int AddSAttr(const TStr &Name, const TAttrType &AttrType, TInt &AttrIdX)
Adds a mapping for an attribute with name Name and type AttrType.
void Clr()
Clears the contents of the attribute map.
int AddSAttrDat(const TIntPr &Id, const TStr &AttrName, const TInt &Val)
Add Int attribute with name AttrName for the given id Id.
void Save(TSOut &SOut) const
Saves the attributes to a (binary) stream SOut.
int DelSAttrDat(const TIntPr &Id, const TStr &AttrName)
Delete attribute with name AttrName for the given id Id.
void GetSAttrV(const TIntPr &Id, const TAttrType AttrType, TAttrPrV &AttrV) const
Get a list of all attributes of the given type AttrType for the given id Id.
void Clr(const bool &DoDel=true, const int &NoDelLim=-1, const bool &ResetDat=true)
int GetSAttrId(const TStr &Name, TInt &AttrIdX, TAttrType &AttrTypeX) const
Given the attribute name Name, get the attribute id.
void Load(TSIn &SIn)
Load attribute from input stream.
TAttrPair(const TAttrPair &Attrs)
TAttr(TSIn &SIn)
Constructor for loading attributes from a (binary) stream SIn.
void Clr()
Clears the contents of the attribute map.
int AddSAttr(const TStr &Name, const TAttrType &AttrType, TInt &AttrIdX)
Adds a mapping for an attribute with name Name and type AttrType.
Vector is a sequence TVal objects representing an array that can change in size.