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

#include <GA_GroupTable.h>

+ Inheritance diagram for GA_GroupTable:

Classes

class  Filter
 
class  iterator
 

Public Types

typedef UT_ArrayStringMap
< GA_Group * > 
MapType
 

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...
 
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 &from_name)
 
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
 
GA_GroupUPtr createDetachedGroup () const
 
GA_GroupnewDetachedGroup () 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)
 

Friends

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

Detailed Description

Definition at line 43 of file GA_GroupTable.h.

Member Typedef Documentation

Definition at line 46 of file GA_GroupTable.h.

Traverse the group table in alpabetic order.

Definition at line 199 of file GA_GroupTable.h.

Constructor & Destructor Documentation

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

Member Function Documentation

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

Definition at line 220 of file GA_GroupTable.h.

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

Traverse the group table in creation order.

Note
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 191 of file GA_GroupTable.h.

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

Traverse the group table in alpabetic order.

Definition at line 200 of file GA_GroupTable.h.

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

Convenience function for ordered iteration (in subclasses)

Definition at line 214 of file GA_GroupTable.h.

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

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.)

GA_GroupUPtr GA_GroupTable::createDetachedGroup ( ) const

A detached group is not owned by anyone but the caller, so will not track new points and must be deleted by the caller.

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
inlineprotected

Definition at line 222 of file GA_GroupTable.h.

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

Definition at line 193 of file GA_GroupTable.h.

exint GA_GroupTable::entries ( ) const
inline

Definition at line 67 of file GA_GroupTable.h.

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

Definition at line 240 of file GA_GroupTable.h.

const GA_Detail& GA_GroupTable::getDetail ( ) const
inlineprotected

Definition at line 241 of file GA_GroupTable.h.

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

Definition at line 228 of file GA_GroupTable.h.

const MapType& GA_GroupTable::getMap ( ) const
inlineprotected

Used only by GA_AttributeDict.

Definition at line 271 of file GA_GroupTable.h.

virtual int64 GA_GroupTable::getMemoryUsage ( bool  inclusive) const
virtual

Report memory usage (includes all shared memory)

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

Definition at line 63 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 
)
static

Stat the group from the JSON stream.

GA_Group* GA_GroupTable::newDetachedGroup ( ) const
inline

A detached group is not owned by anyone but the caller, so will not track new points and must be deleted by the caller.

Definition at line 83 of file GA_GroupTable.h.

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 
)
protected
GA_Group* GA_GroupTable::newInternalGroup ( )
ordered_iterator GA_GroupTable::obegin ( ) const
inline

Traverse the group table in alpabetic order.

Definition at line 202 of file GA_GroupTable.h.

ordered_iterator GA_GroupTable::oend ( ) const
inline

Traverse the group table in alpabetic order.

Definition at line 207 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 from_name)

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

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

void GA_GroupTable::reserveNewSymbolTableSpace ( exint  n)
inlineprotected

Definition at line 262 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
friend

Definition at line 268 of file GA_GroupTable.h.


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