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
GroupStmt Class Reference

A class representing a cached grouping statement identifier. More...

#include <table.h>

Collaboration diagram for GroupStmt:

Public Member Functions

 GroupStmt ()
 
 GroupStmt (const TStrV &Attrs)
 
 GroupStmt (const TStrV &Attrs, TBool ordered, TBool physical)
 
 GroupStmt (const GroupStmt &stmt)
 
TBool UsePhysicalIds ()
 
TBool operator== (const GroupStmt &stmt) const
 
TBool IsValid ()
 
void Invalidate ()
 
TBool IncludesAttr (const TStr &Attr)
 
TSize GetMemUsed () const
 
int GetPrimHashCd () const
 
int GetSecHashCd () const
 
void Print ()
 

Protected Attributes

TStrV GroupByAttrs
 
TBool Ordered
 
TBool UsePhysicalRowIds
 
TBool Valid
 

Detailed Description

A class representing a cached grouping statement identifier.

Definition at line 266 of file table.h.

Constructor & Destructor Documentation

GroupStmt::GroupStmt ( )
inline

Definition at line 273 of file table.h.

273 : GroupByAttrs(TStrV()), Ordered(true), UsePhysicalRowIds(true), Valid(true){}
TBool Valid
Definition: table.h:271
TBool UsePhysicalRowIds
Definition: table.h:270
TStrV GroupByAttrs
Definition: table.h:268
TBool Ordered
Definition: table.h:269
TVec< TStr > TStrV
Definition: ds.h:1599
GroupStmt::GroupStmt ( const TStrV Attrs)
inline

Definition at line 274 of file table.h.

274 : GroupByAttrs(Attrs), Ordered(true), UsePhysicalRowIds(true), Valid(true){}
TBool Valid
Definition: table.h:271
TBool UsePhysicalRowIds
Definition: table.h:270
TStrV GroupByAttrs
Definition: table.h:268
TBool Ordered
Definition: table.h:269
GroupStmt::GroupStmt ( const TStrV Attrs,
TBool  ordered,
TBool  physical 
)
inline

Definition at line 275 of file table.h.

275 : GroupByAttrs(Attrs), Ordered(ordered), UsePhysicalRowIds(physical), Valid(true){}
TBool Valid
Definition: table.h:271
TBool UsePhysicalRowIds
Definition: table.h:270
TStrV GroupByAttrs
Definition: table.h:268
TBool Ordered
Definition: table.h:269
GroupStmt::GroupStmt ( const GroupStmt stmt)
inline

Definition at line 276 of file table.h.

TBool Valid
Definition: table.h:271
TBool UsePhysicalRowIds
Definition: table.h:270
TStrV GroupByAttrs
Definition: table.h:268
TBool Ordered
Definition: table.h:269

Member Function Documentation

TSize GroupStmt::GetMemUsed ( ) const
inline

Definition at line 294 of file table.h.

References TVec< TVal, TSizeTy >::GetMemUsed(), and TVec< TVal, TSizeTy >::Len().

294  {
295  TSize sz = 3 * sizeof(TBool);
296  sz += GroupByAttrs.GetMemUsed();
297  for(int i = 0; i < GroupByAttrs.Len(); i++){
298  sz += GroupByAttrs[i].GetMemUsed();
299  }
300  return sz;
301  }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
TSizeTy GetMemUsed() const
Returns the memory footprint (the number of bytes) of the vector.
Definition: ds.h:511
TStrV GroupByAttrs
Definition: table.h:268
size_t TSize
Definition: bd.h:58
Definition: dt.h:974

Here is the call graph for this function:

int GroupStmt::GetPrimHashCd ( ) const
inline

Definition at line 303 of file table.h.

References TPairHashImpl2::GetHashCd(), TTriple< TVal1, TVal2, TVal3 >::GetPrimHashCd(), and TVec< TVal, TSizeTy >::GetPrimHashCd().

303  {
304  int hc1 = GroupByAttrs.GetPrimHashCd();
306  int hc2 = flags.GetPrimHashCd();
307  return TPairHashImpl::GetHashCd(hc1, hc2);
308  }
int GetPrimHashCd() const
Returns primary hash code of the vector. Used by THash.
Definition: ds.h:999
Definition: ds.h:130
TStrV GroupByAttrs
Definition: table.h:268
static int GetHashCd(const int hc1, const int hc2)
Definition: bd.h:590
int GetPrimHashCd() const
Definition: ds.h:156

Here is the call graph for this function:

int GroupStmt::GetSecHashCd ( ) const
inline

Definition at line 310 of file table.h.

References TPairHashImpl2::GetHashCd(), TTriple< TVal1, TVal2, TVal3 >::GetSecHashCd(), and TVec< TVal, TSizeTy >::GetSecHashCd().

310  {
311  int hc1 = GroupByAttrs.GetSecHashCd();
313  int hc2 = flags.GetSecHashCd();
314  return TPairHashImpl::GetHashCd(hc1, hc2);
315  }
Definition: ds.h:130
int GetSecHashCd() const
Returns secondary hash code of the vector. Used by THash.
Definition: ds.h:1011
int GetSecHashCd() const
Definition: ds.h:157
TStrV GroupByAttrs
Definition: table.h:268
static int GetHashCd(const int hc1, const int hc2)
Definition: bd.h:590

Here is the call graph for this function:

TBool GroupStmt::IncludesAttr ( const TStr Attr)
inline

Definition at line 288 of file table.h.

References TVec< TVal, TSizeTy >::Len().

288  {
289  for(int i = 0; i < GroupByAttrs.Len(); i++){
290  if(GroupByAttrs[i] == Attr){ return true;}
291  }
292  return false;
293  }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
TStrV GroupByAttrs
Definition: table.h:268

Here is the call graph for this function:

void GroupStmt::Invalidate ( )
inline

Definition at line 287 of file table.h.

287 { Valid = false;}
TBool Valid
Definition: table.h:271
TBool GroupStmt::IsValid ( )
inline

Definition at line 286 of file table.h.

References Valid.

286 { return Valid;}
TBool Valid
Definition: table.h:271
TBool GroupStmt::operator== ( const GroupStmt stmt) const
inline

Definition at line 278 of file table.h.

References GroupByAttrs, TVec< TVal, TSizeTy >::Len(), Ordered, and UsePhysicalRowIds.

278  {
279  if(stmt.Ordered != Ordered || stmt.UsePhysicalRowIds != UsePhysicalRowIds){ return false;}
280  if(stmt.GroupByAttrs.Len() != GroupByAttrs.Len()){ return false;}
281  for(int i = 0; i < GroupByAttrs.Len(); i++){
282  if(stmt.GroupByAttrs[i] != GroupByAttrs[i]){ return false;}
283  }
284  return true;
285  }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
TBool UsePhysicalRowIds
Definition: table.h:270
TStrV GroupByAttrs
Definition: table.h:268
TBool Ordered
Definition: table.h:269

Here is the call graph for this function:

void GroupStmt::Print ( )
inline

Definition at line 317 of file table.h.

References TVec< TVal, TSizeTy >::Len(), and TBool::Val.

317  {
318  for(int i = 0; i < GroupByAttrs.Len(); i++){
319  printf("%s ", GroupByAttrs[i].CStr());
320  }
321  printf("Ordered: %d, UsePhysicalRows: %d, Valid: %d\n", Ordered.Val, UsePhysicalRowIds.Val, Valid.Val);
322  }
TBool Valid
Definition: table.h:271
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
TBool UsePhysicalRowIds
Definition: table.h:270
TStrV GroupByAttrs
Definition: table.h:268
bool Val
Definition: dt.h:976
TBool Ordered
Definition: table.h:269

Here is the call graph for this function:

TBool GroupStmt::UsePhysicalIds ( )
inline

Definition at line 277 of file table.h.

References UsePhysicalRowIds.

277 {return UsePhysicalRowIds;}
TBool UsePhysicalRowIds
Definition: table.h:270

Member Data Documentation

TStrV GroupStmt::GroupByAttrs
protected

Definition at line 268 of file table.h.

Referenced by operator==().

TBool GroupStmt::Ordered
protected

Definition at line 269 of file table.h.

Referenced by operator==().

TBool GroupStmt::UsePhysicalRowIds
protected

Definition at line 270 of file table.h.

Referenced by operator==(), and UsePhysicalIds().

TBool GroupStmt::Valid
protected

Definition at line 271 of file table.h.

Referenced by IsValid().


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