All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GA_GroupTable Class Referenceabstract

#include <GA_GroupTable.h>

+ Inheritance diagram for GA_GroupTable:


class  Filter
class  iterator

Public Types

typedef UT_ArrayStringMap
< GA_Group * > 

Public Member Functions

 GA_GroupTable (GA_Detail &detail)
virtual ~GA_GroupTable ()
virtual int64 getMemoryUsage (bool inclusive) const
 Report memory usage (includes all shared memory) More...
virtual void countMemory (UT_MemoryCounter &counter, bool inclusive) const
bool isEmpty () const
exint getPersistentCount () const
exint entries () const
GA_Groupfind (const UT_StringRef &name) const
GA_GroupnewGroup (const UT_StringHolder &name)
GA_GroupnewInternalGroup ()
GA_GroupnewGroup (const UT_StringHolder &name, bool internal)
 TODO: Deprecate internal groups with user-specified names. More...
GA_GroupnewDetachedGroup () const
bool destroy (GA_Group *group)
bool destroy (const UT_StringRef &name)
GA_Size destroyGroups (const Filter &filter)
void clear ()
bool renameGroup (const UT_StringRef &fromname, const UT_StringHolder &toname)
UT_StringHolder renameGroupUnspecified (const UT_StringRef &fromName)
bool jsonSave (UT_JSONWriter &w, const GA_SaveMap &map, const char *type) const
bool jsonLoad (UT_JSONParser &p, const GA_LoadMap &map, const char *type_default, GA_AttributeOwner owner)
 Load the groups from the JSON stream. More...
bool jsonShouldSave (const GA_SaveMap &map) const
 Returns true if there are any groups to be saved out. More...
GA_GroupTable::iterator< GA_GroupbeginTraverse () const
GA_GroupTable::iterator< GA_GroupendTraverse () const
void stat (UT_StringArray &info, uint level)
void stat (GA_Stat &stat, uint level) const

Static Public Member Functions

static bool jsonStat (UT_JSONParser &p, GA_Stat &sbuf, GA_GroupType owner)
 Stat the group from the JSON stream. More...

Protected Member Functions

template<typename T >
iterator< Tbegin () const
template<typename T >
iterator< Tend () const
template<typename GROUP_TYPE >
void getListT (UT_Array< GROUP_TYPE * > &list) const
GA_DetailgetDetail ()
const GA_DetailgetDetail () const
virtual GA_GroupjsonCreateGroup (UT_JSONParser &p, const char *type, const char *name, bool internal, GA_AttributeOwner owner)=0
virtual GA_GroupvirtualCreateGroup (GA_Detail &detail, const UT_StringHolder &name, bool internal) const =0
virtual GA_GroupvirtualCreateDetachedGroup (const GA_Detail &detail) const =0
GA_GroupnewGroupWithNoConflict (const UT_StringHolder &name, bool internal)
void reserveNewSymbolTableSpace (exint n)
const MapTypegetMap () const
 Used only by GA_AttributeDict. More...

Static Protected Member Functions

static int compareGroupName (const GA_Group &a, const GA_Group &b)


class GA_AttributeDict
typedef UT_OrderedIterator
< GA_Group
*, GA_GroupTable::iterator
< GA_Group > > 
ordered_iterator obegin () const
ordered_iterator oend () const
static int compareAlpha (GA_Group *const *a, GA_Group *const *b)

Detailed Description

Definition at line 42 of file GA_GroupTable.h.

Member Typedef Documentation

Definition at line 45 of file GA_GroupTable.h.

Traverse the group table in alpabetic order.

Definition at line 192 of file GA_GroupTable.h.

Constructor & Destructor Documentation

GA_GroupTable::GA_GroupTable ( GA_Detail detail)
virtual GA_GroupTable::~GA_GroupTable ( )

Member Function Documentation

template<typename T >
iterator<T> GA_GroupTable::begin ( void  ) const

Definition at line 213 of file GA_GroupTable.h.

GA_GroupTable::iterator<GA_Group> GA_GroupTable::beginTraverse ( ) const

Traverse the group table in creation order.

Derived classes will add their own specialized versions of begin() and end() and call them beginTraverse() and endTraverse(). These were named begin/endTraverse() to avoid any method hiding as the return types are different.

Definition at line 184 of file GA_GroupTable.h.

void GA_GroupTable::clear ( )
static int GA_GroupTable::compareAlpha ( GA_Group *const a,
GA_Group *const b 

Traverse the group table in alpabetic order.

Definition at line 193 of file GA_GroupTable.h.

static int GA_GroupTable::compareGroupName ( const GA_Group a,
const GA_Group b 

Convenience function for ordered iteration (in subclasses)

Definition at line 207 of file GA_GroupTable.h.

virtual void GA_GroupTable::countMemory ( UT_MemoryCounter counter,
bool  inclusive 
) const

Count memory usage using a UT_MemoryCounter in order to count shared memory correctly. If inclusive is true, the size of this object is counted, else only memory owned by this object is counted. If this is pointed to by the calling object, inclusive should be true. If this is contained in the calling object, inclusive should be false. (Its memory was already counted in the size of the calling object.)

bool GA_GroupTable::destroy ( GA_Group group)
bool GA_GroupTable::destroy ( const UT_StringRef name)
GA_Size GA_GroupTable::destroyGroups ( const Filter filter)
template<typename T >
iterator<T> GA_GroupTable::end ( void  ) const

Definition at line 215 of file GA_GroupTable.h.

GA_GroupTable::iterator<GA_Group> GA_GroupTable::endTraverse ( ) const

Definition at line 186 of file GA_GroupTable.h.

exint GA_GroupTable::entries ( ) const

Definition at line 66 of file GA_GroupTable.h.

GA_Group* GA_GroupTable::find ( const UT_StringRef name) const
GA_Detail& GA_GroupTable::getDetail ( )

Definition at line 233 of file GA_GroupTable.h.

const GA_Detail& GA_GroupTable::getDetail ( ) const

Definition at line 234 of file GA_GroupTable.h.

template<typename GROUP_TYPE >
void GA_GroupTable::getListT ( UT_Array< GROUP_TYPE * > &  list) const
Derived classes are responsible for ensuring that this template method is only instantiated for the appropriate GROUP_TYPE, if any.

Definition at line 221 of file GA_GroupTable.h.

const MapType& GA_GroupTable::getMap ( ) const

Used only by GA_AttributeDict.

Definition at line 264 of file GA_GroupTable.h.

virtual int64 GA_GroupTable::getMemoryUsage ( bool  inclusive) const

Report memory usage (includes all shared memory)

exint GA_GroupTable::getPersistentCount ( ) const
bool GA_GroupTable::isEmpty ( ) const

Definition at line 62 of file GA_GroupTable.h.

virtual GA_Group* GA_GroupTable::jsonCreateGroup ( UT_JSONParser p,
const char *  type,
const char *  name,
bool  internal,
GA_AttributeOwner  owner 
protectedpure virtual

Method called to create a group during loading. The sub-class should verify that the owner matches the type information.

Implemented in GA_ElementGroupTable, and GA_EdgeGroupTable.

bool GA_GroupTable::jsonLoad ( UT_JSONParser p,
const GA_LoadMap map,
const char *  type_default,
GA_AttributeOwner  owner 

Load the groups from the JSON stream.

bool GA_GroupTable::jsonSave ( UT_JSONWriter w,
const GA_SaveMap map,
const char *  type 
) const

Save array of groups to a JSON stream

JSON Schema: GA_GroupTable

Stores an array of groups.

"name" : "GA_GroupTable",
"description" : "A list of groups. All items should be same type",
"type" : "array",
"items" : { "$ref" : "GA_Group" },
See Also
JSON_FileFormat, GA_Group
bool GA_GroupTable::jsonShouldSave ( const GA_SaveMap map) const

Returns true if there are any groups to be saved out.

static bool GA_GroupTable::jsonStat ( UT_JSONParser p,
GA_Stat sbuf,
GA_GroupType  owner 

Stat the group from the JSON stream.

GA_Group* GA_GroupTable::newDetachedGroup ( ) const
GA_Group* GA_GroupTable::newGroup ( const UT_StringHolder name)
GA_Group* GA_GroupTable::newGroup ( const UT_StringHolder name,
bool  internal 

TODO: Deprecate internal groups with user-specified names.

GA_Group* GA_GroupTable::newGroupWithNoConflict ( const UT_StringHolder name,
bool  internal 
GA_Group* GA_GroupTable::newInternalGroup ( )
ordered_iterator GA_GroupTable::obegin ( ) const

Traverse the group table in alpabetic order.

Definition at line 195 of file GA_GroupTable.h.

ordered_iterator GA_GroupTable::oend ( ) const

Traverse the group table in alpabetic order.

Definition at line 200 of file GA_GroupTable.h.

bool GA_GroupTable::renameGroup ( const UT_StringRef fromname,
const UT_StringHolder toname 
UT_StringHolder GA_GroupTable::renameGroupUnspecified ( const UT_StringRef fromName)

Rename a group to an unused name. Typically used to make fromName available for another group.

Returns new name on success, UT_StringHolder() on failure.

void GA_GroupTable::reserveNewSymbolTableSpace ( exint  n)

Definition at line 255 of file GA_GroupTable.h.

void GA_GroupTable::stat ( UT_StringArray info,
uint  level 

Get information about groups

void GA_GroupTable::stat ( GA_Stat stat,
uint  level 
) const

Get information about groups

virtual GA_Group* GA_GroupTable::virtualCreateGroup ( GA_Detail detail,
const UT_StringHolder name,
bool  internal 
) const
protectedpure virtual

Friends And Related Function Documentation

friend class GA_AttributeDict

Definition at line 261 of file GA_GroupTable.h.

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