SNAP Library 6.0, User Reference  2020-12-09 16:24:20
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
TTableContext Class Reference

Execution context. More...

#include <table.h>

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.

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:1137
TStr TTableContext::GetStr ( const TInt KeyId) const
inline

Returns a string with KeyId.

Definition at line 204 of file table.h.

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
void TTableContext::Load ( TSIn SIn)
inline

Loads TTableContext in binary from SIn.

Definition at line 191 of file table.h.

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
void TTableContext::LoadShM ( TShMIn ShMIn)
inline

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

Definition at line 193 of file table.h.

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
void TTableContext::Save ( TSOut SOut)
inline

Saves TTableContext in binary to SOut.

Definition at line 197 of file table.h.

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

Friends And Related Function Documentation

friend class TTable
friend

Definition at line 183 of file table.h.

Member Data Documentation

TStrHash<TInt, TBigStrPool> TTableContext::StringVals
protected

StringPool - stores string data values and maps them to integers.

Definition at line 182 of file table.h.


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