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
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
GroupStmt Class Reference

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

#include <table.h>

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 275 of file table.h.

Constructor & Destructor Documentation

GroupStmt::GroupStmt ( )
inline

Definition at line 282 of file table.h.

282 : GroupByAttrs(TStrV()), Ordered(true), UsePhysicalRowIds(true), Valid(true){}
TBool Valid
Definition: table.h:280
TBool UsePhysicalRowIds
Definition: table.h:279
TStrV GroupByAttrs
Definition: table.h:277
TBool Ordered
Definition: table.h:278
TVec< TStr > TStrV
Definition: ds.h:1534
GroupStmt::GroupStmt ( const TStrV Attrs)
inline

Definition at line 283 of file table.h.

283 : GroupByAttrs(Attrs), Ordered(true), UsePhysicalRowIds(true), Valid(true){}
TBool Valid
Definition: table.h:280
TBool UsePhysicalRowIds
Definition: table.h:279
TStrV GroupByAttrs
Definition: table.h:277
TBool Ordered
Definition: table.h:278
GroupStmt::GroupStmt ( const TStrV Attrs,
TBool  ordered,
TBool  physical 
)
inline

Definition at line 284 of file table.h.

284 : GroupByAttrs(Attrs), Ordered(ordered), UsePhysicalRowIds(physical), Valid(true){}
TBool Valid
Definition: table.h:280
TBool UsePhysicalRowIds
Definition: table.h:279
TStrV GroupByAttrs
Definition: table.h:277
TBool Ordered
Definition: table.h:278
GroupStmt::GroupStmt ( const GroupStmt stmt)
inline

Definition at line 285 of file table.h.

TBool Valid
Definition: table.h:280
TBool UsePhysicalRowIds
Definition: table.h:279
TStrV GroupByAttrs
Definition: table.h:277
TBool Ordered
Definition: table.h:278

Member Function Documentation

TSize GroupStmt::GetMemUsed ( ) const
inline

Definition at line 303 of file table.h.

303  {
304  TSize sz = 3 * sizeof(TBool);
305  sz += GroupByAttrs.GetMemUsed();
306  for(int i = 0; i < GroupByAttrs.Len(); i++){
307  sz += GroupByAttrs[i].GetMemUsed();
308  }
309  return sz;
310  }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:547
TSizeTy GetMemUsed() const
Returns the memory footprint (the number of bytes) of the vector.
Definition: ds.h:483
TStrV GroupByAttrs
Definition: table.h:277
size_t TSize
Definition: bd.h:58
Definition: dt.h:881
int GroupStmt::GetPrimHashCd ( ) const
inline

Definition at line 312 of file table.h.

312  {
313  int hc1 = GroupByAttrs.GetPrimHashCd();
315  int hc2 = flags.GetPrimHashCd();
316  return TPairHashImpl::GetHashCd(hc1, hc2);
317  }
int GetPrimHashCd() const
Returns primary hash code of the vector. Used by THash.
Definition: ds.h:948
Definition: ds.h:129
TStrV GroupByAttrs
Definition: table.h:277
static int GetHashCd(const int hc1, const int hc2)
Definition: bd.h:590
int GetPrimHashCd() const
Definition: ds.h:155
int GroupStmt::GetSecHashCd ( ) const
inline

Definition at line 319 of file table.h.

319  {
320  int hc1 = GroupByAttrs.GetSecHashCd();
322  int hc2 = flags.GetSecHashCd();
323  return TPairHashImpl::GetHashCd(hc1, hc2);
324  }
Definition: ds.h:129
int GetSecHashCd() const
Returns secondary hash code of the vector. Used by THash.
Definition: ds.h:960
int GetSecHashCd() const
Definition: ds.h:156
TStrV GroupByAttrs
Definition: table.h:277
static int GetHashCd(const int hc1, const int hc2)
Definition: bd.h:590
TBool GroupStmt::IncludesAttr ( const TStr Attr)
inline

Definition at line 297 of file table.h.

297  {
298  for(int i = 0; i < GroupByAttrs.Len(); i++){
299  if(GroupByAttrs[i] == Attr){ return true;}
300  }
301  return false;
302  }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:547
TStrV GroupByAttrs
Definition: table.h:277
void GroupStmt::Invalidate ( )
inline

Definition at line 296 of file table.h.

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

Definition at line 295 of file table.h.

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

Definition at line 287 of file table.h.

287  {
288  if(stmt.Ordered != Ordered || stmt.UsePhysicalRowIds != UsePhysicalRowIds){ return false;}
289  if(stmt.GroupByAttrs.Len() != GroupByAttrs.Len()){ return false;}
290  for(int i = 0; i < GroupByAttrs.Len(); i++){
291  if(stmt.GroupByAttrs[i] != GroupByAttrs[i]){ return false;}
292  }
293  return true;
294  }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:547
TBool UsePhysicalRowIds
Definition: table.h:279
TStrV GroupByAttrs
Definition: table.h:277
TBool Ordered
Definition: table.h:278
void GroupStmt::Print ( )
inline

Definition at line 326 of file table.h.

326  {
327  for(int i = 0; i < GroupByAttrs.Len(); i++){
328  printf("%s ", GroupByAttrs[i].CStr());
329  }
330  printf("Ordered: %d, UsePhysicalRows: %d, Valid: %d\n", Ordered.Val, UsePhysicalRowIds.Val, Valid.Val);
331  }
TBool Valid
Definition: table.h:280
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:547
TBool UsePhysicalRowIds
Definition: table.h:279
TStrV GroupByAttrs
Definition: table.h:277
bool Val
Definition: dt.h:883
TBool Ordered
Definition: table.h:278
TBool GroupStmt::UsePhysicalIds ( )
inline

Definition at line 286 of file table.h.

286 {return UsePhysicalRowIds;}
TBool UsePhysicalRowIds
Definition: table.h:279

Member Data Documentation

TStrV GroupStmt::GroupByAttrs
protected

Definition at line 277 of file table.h.

TBool GroupStmt::Ordered
protected

Definition at line 278 of file table.h.

TBool GroupStmt::UsePhysicalRowIds
protected

Definition at line 279 of file table.h.

TBool GroupStmt::Valid
protected

Definition at line 280 of file table.h.


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