SNAP Library 3.0, User Reference
2016-07-20 17:56:49
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
#include <attr.h>
Public Member Functions | |
TAttr () | |
TAttr (const TAttr &Attrs) | |
TAttr (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... | |
size_t | GetMemUsed () const |
Returns the amount of memory used by sparse attributes. More... | |
int | AddSAttrDat (const TInt &Id, const TStr &AttrName, const TInt &Val) |
Add Int attribute with name AttrName for the given id Id . More... | |
int | AddSAttrDat (const TInt &Id, const TInt &AttrId, const TInt &Val) |
Add Int attribute with attribute id AttrId for the given id Id . More... | |
int | AddSAttrDat (const TInt &Id, const TStr &AttrName, const TFlt &Val) |
Add Flt attribute with name AttrName for the given id Id . More... | |
int | AddSAttrDat (const TInt &Id, const TInt &AttrId, const TFlt &Val) |
Add Flt attribute with attribute id AttrId for the given id Id . More... | |
int | AddSAttrDat (const TInt &Id, const TStr &AttrName, const TStr &Val) |
Add Str attribute with name AttrName for the given id Id . More... | |
int | AddSAttrDat (const TInt &Id, const TInt &AttrId, const TStr &Val) |
Add Str attribute with attribute id AttrId for the given id Id . More... | |
int | GetSAttrDat (const TInt &Id, const TStr &AttrName, TInt &ValX) const |
Get Int attribute with name AttrName for the given id Id . More... | |
int | GetSAttrDat (const TInt &Id, const TInt &AttrId, TInt &ValX) const |
Get Int attribute with attribute id AttrId for the given id Id . More... | |
int | GetSAttrDat (const TInt &Id, const TStr &AttrName, TFlt &ValX) const |
Get Flt attribute with name AttrName for the given id Id . More... | |
int | GetSAttrDat (const TInt &Id, const TInt &AttrId, TFlt &ValX) const |
Get Flt attribute with attribute id AttrId for the given id Id . More... | |
int | GetSAttrDat (const TInt &Id, const TStr &AttrName, TStr &ValX) const |
Get Str attribute with name AttrName for the given id Id . More... | |
int | GetSAttrDat (const TInt &Id, const TInt &AttrId, TStr &ValX) const |
Get Str attribute with attribute id AttrId for the given id Id . More... | |
int | DelSAttrDat (const TInt &Id, const TStr &AttrName) |
Delete attribute with name AttrName for the given id Id . More... | |
int | DelSAttrDat (const TInt &Id, const TInt &AttrId) |
Delete attribute with attribute id AttrId for the given id Id . More... | |
void | DelSAttrId (const TInt &Id) |
Delete all attributes for the given id Id . More... | |
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 . More... | |
int | GetIdVSAttr (const TStr &AttrName, TIntV &IdV) const |
Get a list of all ids that have an attribute with name AttrName . More... | |
int | GetIdVSAttr (const TInt &AttrId, TIntV &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. More... | |
int | GetSAttrName (const TInt &AttrId, TStr &NameX, TAttrType &AttrTypeX) const |
Given the attribute id AttrId , get the attribute name. More... | |
Private Member Functions | |
int | GetIdVSAttr (const TInt &AttrId, const TAttrType Type, TIntV &IdV) const |
Private Attributes | |
TStrIntPrH | AttrNameToId |
TIntIntStrPrH | AttrIdToName |
TIntPrIntH | IntAttrVals |
TIntPrFltH | FltAttrVals |
TIntPrStrH | StrAttrVals |
|
inline |
Adds a mapping for an attribute with name Name
and type AttrType
.
Add Int attribute with name AttrName
for the given id Id
.
Definition at line 2 of file attr.cpp.
Add Int attribute with attribute id AttrId
for the given id Id
.
Definition at line 11 of file attr.cpp.
Add Flt attribute with name AttrName
for the given id Id
.
Definition at line 19 of file attr.cpp.
Add Flt attribute with attribute id AttrId
for the given id Id
.
Definition at line 28 of file attr.cpp.
Add Str attribute with name AttrName
for the given id Id
.
Definition at line 36 of file attr.cpp.
Add Str attribute with attribute id AttrId
for the given id Id
.
Definition at line 45 of file attr.cpp.
|
inline |
Clears the contents of the attribute map.
Definition at line 29 of file attr.h.
Delete attribute with name AttrName
for the given id Id
.
Definition at line 103 of file attr.cpp.
void TAttr::DelSAttrId | ( | const TInt & | Id | ) |
Delete all attributes for the given id Id
.
Get a list of all ids that have an attribute with name AttrName
.
Definition at line 200 of file attr.cpp.
Get a list of all ids that have an attribute with attribute id AttrId
.
Definition at line 192 of file attr.cpp.
|
inline |
Returns the amount of memory used by sparse attributes.
Definition at line 32 of file attr.h.
Get Int attribute with name AttrName
for the given id Id
.
Definition at line 54 of file attr.cpp.
Get Int attribute with attribute id AttrId
for the given id Id
.
Definition at line 59 of file attr.cpp.
Get Flt attribute with name AttrName
for the given id Id
.
Definition at line 70 of file attr.cpp.
Get Flt attribute with attribute id AttrId
for the given id Id
.
Definition at line 75 of file attr.cpp.
Get Str attribute with name AttrName
for the given id Id
.
Definition at line 86 of file attr.cpp.
Get Str attribute with attribute id AttrId
for the given id Id
.
Definition at line 91 of file attr.cpp.
Get a list of all attributes of type AttrType
for the given id Id
.
Definition at line 139 of file attr.cpp.
|
inline |
|
private |
|
private |
|
private |
|
private |
|
private |