SNAP Library 4.0, Developer Reference  2017-07-27 13:18:06
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TTableContext Class Reference

Execution context. More...

#include <table.h>

Collaboration diagram for TTableContext:

Public Member Functions

 TTableContext ()
 Default constructor. More...
 
 TTableContext (TSIn &SIn)
 Loads TTableContext in binary from SIn. More...
 
void Load (TSIn &SIn)
 Loads TTableContext in binary from SIn. More...
 
void LoadShM (TShMIn &ShMIn)
 Loads TTableContext using shared memory, the object is read only. More...
 
void Save (TSOut &SOut)
 Saves TTableContext in binary to SOut. More...
 
TInt AddStr (const TStr &Key)
 Adds string Key to the context, returns its KeyId. More...
 
TStr GetStr (const TInt &KeyId) const
 Returns a string with KeyId. More...
 

Protected Attributes

TStrHash< TInt, TBigStrPoolStringVals
 StringPool - stores string data values and maps them to integers. More...
 

Friends

class TTable
 

Detailed Description

Execution context.

Definition at line 180 of file table.h.

Constructor & Destructor Documentation

TTableContext::TTableContext ( )
inline

Default constructor.

Definition at line 187 of file table.h.

187 {}
TTableContext::TTableContext ( TSIn SIn)
inline

Loads TTableContext in binary from SIn.

Definition at line 189 of file table.h.

189 : StringVals(SIn) {}
TStrHash< TInt, TBigStrPool > StringVals
StringPool - stores string data values and maps them to integers.
Definition: table.h:182

Member Function Documentation

TInt TTableContext::AddStr ( const TStr Key)
inline

Adds string Key to the context, returns its KeyId.

Definition at line 199 of file table.h.

References TStrHash< TDat, TStringPool, THashFunc >::AddKey(), and StringVals.

199  {
200  TInt KeyId = TInt(StringVals.AddKey(Key));
201  return(KeyId);
202  }
TStrHash< TInt, TBigStrPool > StringVals
StringPool - stores string data values and maps them to integers.
Definition: table.h:182
int AddKey(const char *Key)
Definition: hash.h:968
Definition: dt.h:1134

Here is the call graph for this function:

TStr TTableContext::GetStr ( const TInt KeyId) const
inline

Returns a string with KeyId.

Definition at line 204 of file table.h.

References TStrHash< TDat, TStringPool, THashFunc >::GetKey(), and StringVals.

204  {
205  return StringVals.GetKey(KeyId);
206  }
const char * GetKey(const int &KeyId) const
Definition: hash.h:893
TStrHash< TInt, TBigStrPool > StringVals
StringPool - stores string data values and maps them to integers.
Definition: table.h:182

Here is the call graph for this function:

void TTableContext::Load ( TSIn SIn)
inline

Loads TTableContext in binary from SIn.

Definition at line 191 of file table.h.

References TStrHash< TDat, TStringPool, THashFunc >::Load(), and StringVals.

191 { StringVals.Load(SIn); }
TStrHash< TInt, TBigStrPool > StringVals
StringPool - stores string data values and maps them to integers.
Definition: table.h:182
void Load(TSIn &SIn, bool PoolToo=true)
Definition: hash.h:811

Here is the call graph for this function:

void TTableContext::LoadShM ( TShMIn ShMIn)
inline

Loads TTableContext using shared memory, the object is read only.

Definition at line 193 of file table.h.

References TStrHash< TDat, TStringPool, THashFunc >::LoadShM(), and StringVals.

193  {
194  StringVals.LoadShM(ShMIn, true);
195  }
void LoadShM(TShMIn &ShMIn, bool SharedPool=true)
Load hash from shared memory. If shared pool is true load pool from shared memory.
Definition: hash.h:815
TStrHash< TInt, TBigStrPool > StringVals
StringPool - stores string data values and maps them to integers.
Definition: table.h:182

Here is the call graph for this function:

void TTableContext::Save ( TSOut SOut)
inline

Saves TTableContext in binary to SOut.

Definition at line 197 of file table.h.

References TStrHash< TDat, TStringPool, THashFunc >::Save(), and StringVals.

197 { StringVals.Save(SOut); }
void Save(TSOut &SOut, bool PoolToo=true) const
Definition: hash.h:833
TStrHash< TInt, TBigStrPool > StringVals
StringPool - stores string data values and maps them to integers.
Definition: table.h:182

Here is the call graph for this function:

Friends And Related Function Documentation

friend class TTable
friend

Definition at line 183 of file table.h.

Member Data Documentation


The documentation for this class was generated from the following file: