SNAP Library 6.0, Developer Reference
2020-12-09 16:24:20
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
#include <attr.h>
Public Member Functions | |
TAttrPair () | |
TAttrPair (const TAttrPair &Attrs) | |
TAttrPair (TSIn &SIn) | |
Constructor for loading attributes from a (binary) stream SIn. More... | |
void | Save (TSOut &SOut) const |
Saves the attributes to a (binary) stream SOut. More... | |
void | Clr () |
Clears the contents of the attribute map. More... | |
int | AddSAttrDat (const TIntPr &Id, const TStr &AttrName, const TInt &Val) |
Add Int attribute with name AttrName for the given id Id . More... | |
int | AddSAttrDat (const TIntPr &Id, const TInt &AttrId, const TInt &Val) |
Add Int attribute with attribute id AttrId for the given id Id . More... | |
int | AddSAttrDat (const TIntPr &Id, const TStr &AttrName, const TFlt &Val) |
Add Flt attribute with name AttrName for the given id Id . More... | |
int | AddSAttrDat (const TIntPr &Id, const TInt &AttrId, const TFlt &Val) |
Add Flt attribute with attribute id AttrId for the given id Id . More... | |
int | AddSAttrDat (const TIntPr &Id, const TStr &AttrName, const TStr &Val) |
Add Str attribute with name AttrName for the given id Id . More... | |
int | AddSAttrDat (const TIntPr &Id, const TInt &AttrId, const TStr &Val) |
Add Str attribute with attribute id AttrId for the given id Id . More... | |
int | GetSAttrDat (const TIntPr &Id, const TStr &AttrName, TInt &ValX) const |
Get Int attribute with name AttrName for the given id Id . More... | |
int | GetSAttrDat (const TIntPr &Id, const TInt &AttrId, TInt &ValX) const |
Get Int attribute with attribute id AttrId for the given id Id . More... | |
int | GetSAttrDat (const TIntPr &Id, const TStr &AttrName, TFlt &ValX) const |
Get Flt attribute with name AttrName for the given id Id . More... | |
int | GetSAttrDat (const TIntPr &Id, const TInt &AttrId, TFlt &ValX) const |
Get Flt attribute with attribute id AttrId for the given id Id . More... | |
int | GetSAttrDat (const TIntPr &Id, const TStr &AttrName, TStr &ValX) const |
Get Str attribute with name AttrName for the given id Id . More... | |
int | GetSAttrDat (const TIntPr &Id, const TInt &AttrId, TStr &ValX) const |
Get Str attribute with attribute id AttrId for the given id Id . More... | |
int | DelSAttrDat (const TIntPr &Id, const TStr &AttrName) |
Delete attribute with name AttrName for the given id Id . More... | |
int | DelSAttrDat (const TIntPr &Id, const TInt &AttrId) |
Delete attribute with attribute id AttrId for the given id Id . More... | |
void | DelSAttrId (const TIntPr &Id) |
Delete all attributes for the given id Id . More... | |
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 . More... | |
int | GetIdVSAttr (const TStr &AttrName, TIntPrV &IdV) const |
Get a list of all ids that have an attribute with name AttrName . More... | |
int | GetIdVSAttr (const TInt &AttrId, TIntPrV &IdV) const |
Get a list of all ids that have an attribute with attribute id AttrId . More... | |
int | AddSAttr (const TStr &Name, const TAttrType &AttrType, TInt &AttrIdX) |
Adds a mapping for an attribute with name Name and type AttrType . More... | |
int | GetSAttrId (const TStr &Name, TInt &AttrIdX, TAttrType &AttrTypeX) const |
Given the attribute name Name , get the attribute id and type. More... | |
int | GetSAttrName (const TInt &AttrId, TStr &NameX, TAttrType &AttrTypeX) const |
Given the attribute id AttrId , get the attribute name and type. More... | |
Private Member Functions | |
int | GetIdVSAttr (const TInt &AttrId, const TAttrType Type, TIntPrV &IdV) const |
Private Attributes | |
TStrIntPrH | AttrNameToId |
TIntIntStrPrH | AttrIdToName |
TIntIntPrPrIntH | IntAttrVals |
TIntIntPrPrFltH | FltAttrVals |
TIntIntPrPrStrH | StrAttrVals |
|
inline |
Adds a mapping for an attribute with name Name and type AttrType
.
Definition at line 454 of file attr.cpp.
References THash< TKey, TDat, THashFunc >::AddDat(), atFlt, atInt, atStr, AttrIdToName, AttrNameToId, and THash< TKey, TDat, THashFunc >::GetMxKeyIds().
Referenced by AddSAttrDat().
Add Int attribute with name AttrName
for the given id Id
.
Definition at line 246 of file attr.cpp.
References AddSAttr(), atInt, AttrNameToId, THash< TKey, TDat, THashFunc >::GetDat(), TPair< TVal1, TVal2 >::GetVal2(), and THash< TKey, TDat, THashFunc >::IsKey().
Referenced by AddSAttrDat().
Add Int attribute with attribute id AttrId
for the given id Id
.
Definition at line 255 of file attr.cpp.
References THash< TKey, TDat, THashFunc >::AddDat(), atInt, AttrIdToName, THash< TKey, TDat, THashFunc >::GetDat(), TPair< TVal1, TVal2 >::GetVal1(), IntAttrVals, and THash< TKey, TDat, THashFunc >::IsKey().
Add Flt attribute with name AttrName
for the given id Id
.
Definition at line 263 of file attr.cpp.
References AddSAttr(), AddSAttrDat(), atFlt, AttrNameToId, THash< TKey, TDat, THashFunc >::GetDat(), TPair< TVal1, TVal2 >::GetVal2(), and THash< TKey, TDat, THashFunc >::IsKey().
Add Flt attribute with attribute id AttrId
for the given id Id
.
Definition at line 272 of file attr.cpp.
References THash< TKey, TDat, THashFunc >::AddDat(), atFlt, AttrIdToName, FltAttrVals, THash< TKey, TDat, THashFunc >::GetDat(), TPair< TVal1, TVal2 >::GetVal1(), and THash< TKey, TDat, THashFunc >::IsKey().
Add Str attribute with name AttrName
for the given id Id
.
Definition at line 280 of file attr.cpp.
References AddSAttr(), AddSAttrDat(), atStr, AttrNameToId, THash< TKey, TDat, THashFunc >::GetDat(), TPair< TVal1, TVal2 >::GetVal2(), and THash< TKey, TDat, THashFunc >::IsKey().
Add Str attribute with attribute id AttrId
for the given id Id
.
Definition at line 289 of file attr.cpp.
References THash< TKey, TDat, THashFunc >::AddDat(), atStr, AttrIdToName, THash< TKey, TDat, THashFunc >::GetDat(), TPair< TVal1, TVal2 >::GetVal1(), THash< TKey, TDat, THashFunc >::IsKey(), and StrAttrVals.
|
inline |
Clears the contents of the attribute map.
Definition at line 122 of file attr.h.
References THash< TKey, TDat, THashFunc >::Clr().
Referenced by TUndirNet::Clr(), and TDirNet::Clr().
Delete attribute with name AttrName
for the given id Id
.
Definition at line 347 of file attr.cpp.
References AttrNameToId, THash< TKey, TDat, THashFunc >::GetDat(), TPair< TVal1, TVal2 >::GetVal2(), and THash< TKey, TDat, THashFunc >::IsKey().
Delete attribute with attribute id AttrId
for the given id Id
.
Definition at line 352 of file attr.cpp.
References THash< TKey, TDat, THashFunc >::DelKey(), FltAttrVals, IntAttrVals, THash< TKey, TDat, THashFunc >::IsKey(), and StrAttrVals.
void TAttrPair::DelSAttrId | ( | const TIntPr & | Id | ) |
Delete all attributes for the given id Id
.
Definition at line 368 of file attr.cpp.
References atFlt, atInt, atStr, AttrNameToId, THash< TKey, TDat, THashFunc >::BegI(), THash< TKey, TDat, THashFunc >::DelIfKey(), THash< TKey, TDat, THashFunc >::EndI(), FltAttrVals, IntAttrVals, and StrAttrVals.
|
private |
Definition at line 411 of file attr.cpp.
References TVec< TVal, TSizeTy >::Add(), atFlt, atInt, atStr, THash< TKey, TDat, THashFunc >::BegI(), THash< TKey, TDat, THashFunc >::EndI(), FltAttrVals, IntAttrVals, and StrAttrVals.
Referenced by GetIdVSAttr().
Get a list of all ids that have an attribute with name AttrName
.
Definition at line 436 of file attr.cpp.
References AttrNameToId, THash< TKey, TDat, THashFunc >::GetDat(), GetIdVSAttr(), TPair< TVal1, TVal2 >::GetVal1(), TPair< TVal1, TVal2 >::GetVal2(), and THash< TKey, TDat, THashFunc >::IsKey().
Get a list of all ids that have an attribute with attribute id AttrId
.
Definition at line 445 of file attr.cpp.
References AttrIdToName, THash< TKey, TDat, THashFunc >::GetDat(), GetIdVSAttr(), TPair< TVal1, TVal2 >::GetVal1(), and THash< TKey, TDat, THashFunc >::IsKey().
Get Int attribute with name AttrName
for the given id Id
.
Definition at line 298 of file attr.cpp.
References AttrNameToId, THash< TKey, TDat, THashFunc >::GetDat(), TPair< TVal1, TVal2 >::GetVal2(), and THash< TKey, TDat, THashFunc >::IsKey().
Referenced by GetSAttrDat().
Get Int attribute with attribute id AttrId
for the given id Id
.
Definition at line 303 of file attr.cpp.
References atInt, AttrIdToName, THash< TKey, TDat, THashFunc >::GetDat(), TPair< TVal1, TVal2 >::GetVal1(), IntAttrVals, and THash< TKey, TDat, THashFunc >::IsKey().
Get Flt attribute with name AttrName
for the given id Id
.
Definition at line 314 of file attr.cpp.
References AttrNameToId, THash< TKey, TDat, THashFunc >::GetDat(), GetSAttrDat(), TPair< TVal1, TVal2 >::GetVal2(), and THash< TKey, TDat, THashFunc >::IsKey().
Get Flt attribute with attribute id AttrId
for the given id Id
.
Definition at line 319 of file attr.cpp.
References atFlt, AttrIdToName, FltAttrVals, THash< TKey, TDat, THashFunc >::GetDat(), TPair< TVal1, TVal2 >::GetVal1(), and THash< TKey, TDat, THashFunc >::IsKey().
Get Str attribute with name AttrName
for the given id Id
.
Definition at line 330 of file attr.cpp.
References AttrNameToId, THash< TKey, TDat, THashFunc >::GetDat(), GetSAttrDat(), TPair< TVal1, TVal2 >::GetVal2(), and THash< TKey, TDat, THashFunc >::IsKey().
Get Str attribute with attribute id AttrId
for the given id Id
.
Definition at line 335 of file attr.cpp.
References atStr, AttrIdToName, THash< TKey, TDat, THashFunc >::GetDat(), TPair< TVal1, TVal2 >::GetVal1(), THash< TKey, TDat, THashFunc >::IsKey(), and StrAttrVals.
Given the attribute name Name
, get the attribute id and type.
Definition at line 467 of file attr.cpp.
References AttrNameToId, THash< TKey, TDat, THashFunc >::GetDat(), TPair< TVal1, TVal2 >::GetVal1(), TPair< TVal1, TVal2 >::GetVal2(), and THash< TKey, TDat, THashFunc >::IsKey().
Given the attribute id AttrId
, get the attribute name and type.
Definition at line 477 of file attr.cpp.
References AttrIdToName, THash< TKey, TDat, THashFunc >::GetDat(), TPair< TVal1, TVal2 >::GetVal1(), TPair< TVal1, TVal2 >::GetVal2(), and THash< TKey, TDat, THashFunc >::IsKey().
Get a list of all attributes of the given type AttrType
for the given id Id
.
Definition at line 383 of file attr.cpp.
References TVec< TVal, TSizeTy >::Add(), atFlt, atInt, atStr, AttrNameToId, THash< TKey, TDat, THashFunc >::BegI(), THash< TKey, TDat, THashFunc >::EndI(), FltAttrVals, IntAttrVals, THash< TKey, TDat, THashFunc >::IsKey(), and StrAttrVals.
|
inline |
Saves the attributes to a (binary) stream SOut.
Definition at line 118 of file attr.h.
References THash< TKey, TDat, THashFunc >::Save().
Referenced by TUndirNet::Save(), and TDirNet::Save().
|
private |
Definition at line 101 of file attr.h.
Referenced by AddSAttr(), AddSAttrDat(), GetIdVSAttr(), GetSAttrDat(), and GetSAttrName().
|
private |
Definition at line 100 of file attr.h.
Referenced by AddSAttr(), AddSAttrDat(), DelSAttrDat(), DelSAttrId(), GetIdVSAttr(), GetSAttrDat(), GetSAttrId(), and GetSAttrV().
|
private |
Definition at line 104 of file attr.h.
Referenced by AddSAttrDat(), DelSAttrDat(), DelSAttrId(), GetIdVSAttr(), GetSAttrDat(), and GetSAttrV().
|
private |
Definition at line 103 of file attr.h.
Referenced by AddSAttrDat(), DelSAttrDat(), DelSAttrId(), GetIdVSAttr(), GetSAttrDat(), and GetSAttrV().
|
private |
Definition at line 105 of file attr.h.
Referenced by AddSAttrDat(), DelSAttrDat(), DelSAttrId(), GetIdVSAttr(), GetSAttrDat(), and GetSAttrV().