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

#include <GA_Group.h>

+ Inheritance diagram for GA_Group:

Public Member Functions

virtual ~GA_Group ()
 
const UT_StringHoldergetName () const
 
virtual const GA_DetailgetDetail () const =0
 
bool isInternal () const
 
bool getInternal () const
 
void setInternal (bool on_off)
 
bool isDetached () const
 
GA_GroupType classType () const
 
GA_GroupMaskType classMaskType () const
 
bool isElementGroup () const
 
virtual int64 getMemoryUsage (bool inclusive) const =0
 
virtual void countMemory (UT_MemoryCounter &counter, bool inclusive) const =0
 
virtual GA_Size entries () const =0
 
SYS_FORCE_INLINE bool isEmpty () const
 
virtual void clear ()=0
 
virtual void addAll ()=0
 
virtual bool isOrdered () const =0
 
virtual bool isMixed () const =0
 
virtual bool combine (const GA_Group *input_group)
 
void clearEntries ()
 
virtual bool stat (UT_WorkBuffer &info, uint level) const
 
virtual bool jsonShouldSave (const GA_SaveMap &map) const
 
bool jsonSaveDefinition (UT_JSONWriter &w, const char *type) const
 
virtual bool jsonSaveData (UT_JSONWriter &w, const GA_SaveMap &map) const =0
 Save the private group data. More...
 
virtual bool jsonLoadData (UT_JSONParser &p, const GA_LoadMap &map)=0
 Load the private group data. More...
 
void dump (std::ostream &os)
 A convenience function to do a JSON dump of the group contents. More...
 

Static Public Member Functions

static const char * groupType (GA_GroupType type)
 
static GA_GroupType groupType (const char *type)
 
static bool jsonLoadDefinition (UT_JSONParser &p, UT_WorkBuffer &type, UT_WorkBuffer &name, bool &internal)
 Load the GA_Group-Definition. More...
 

Protected Member Functions

 GA_Group (const UT_StringHolder &name, bool internal, GA_GroupType type, bool detached)
 
virtual bool setName (const UT_StringHolder &n)
 

Friends

class GA_GroupTable
 

Detailed Description

Definition at line 35 of file GA_Group.h.

Constructor & Destructor Documentation

GA_Group::GA_Group ( const UT_StringHolder name,
bool  internal,
GA_GroupType  type,
bool  detached 
)
protected
virtual GA_Group::~GA_Group ( )
virtual

Member Function Documentation

virtual void GA_Group::addAll ( )
pure virtual
GA_GroupMaskType GA_Group::classMaskType ( ) const
inline

Definition at line 56 of file GA_Group.h.

GA_GroupType GA_Group::classType ( ) const
inline

Definition at line 54 of file GA_Group.h.

virtual void GA_Group::clear ( )
pure virtual
void GA_Group::clearEntries ( )
inline

Definition at line 98 of file GA_Group.h.

virtual bool GA_Group::combine ( const GA_Group input_group)
virtual

Reimplemented in GA_EdgeGroup, and GA_ElementGroup.

virtual void GA_Group::countMemory ( UT_MemoryCounter counter,
bool  inclusive 
) const
pure 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.)

Implemented in GA_EdgeGroup, GA_ElementGroup, and GA_BreakpointGroup.

void GA_Group::dump ( std::ostream &  os)

A convenience function to do a JSON dump of the group contents.

virtual GA_Size GA_Group::entries ( ) const
pure virtual
virtual const GA_Detail& GA_Group::getDetail ( ) const
pure virtual
bool GA_Group::getInternal ( ) const
inline

Definition at line 46 of file GA_Group.h.

virtual int64 GA_Group::getMemoryUsage ( bool  inclusive) const
pure virtual

Report memory usage NOTE: GA_ElementGroup DOES NOT include the memory for the attribute unless the attribute is detached, because the GA_ElementGroup only owns the attribute if it is detached.

Implemented in GA_EdgeGroup, GA_ElementGroup, and GA_BreakpointGroup.

const UT_StringHolder& GA_Group::getName ( ) const
inline

Definition at line 42 of file GA_Group.h.

static const char* GA_Group::groupType ( GA_GroupType  type)
inlinestatic

Definition at line 58 of file GA_Group.h.

static GA_GroupType GA_Group::groupType ( const char *  type)
inlinestatic

Definition at line 60 of file GA_Group.h.

bool GA_Group::isDetached ( ) const
inline

Detached groups are not owned by a GA_Detail. This means they will not update if their GA_Detail's element count changes. It also means they must be explicitly deleted

Definition at line 52 of file GA_Group.h.

bool GA_Group::isElementGroup ( ) const
inline

Definition at line 63 of file GA_Group.h.

SYS_FORCE_INLINE bool GA_Group::isEmpty ( ) const
inline

Definition at line 87 of file GA_Group.h.

bool GA_Group::isInternal ( ) const
inline

Definition at line 45 of file GA_Group.h.

virtual bool GA_Group::isMixed ( ) const
pure virtual
virtual bool GA_Group::isOrdered ( ) const
pure virtual
virtual bool GA_Group::jsonLoadData ( UT_JSONParser p,
const GA_LoadMap map 
)
pure virtual

Load the private group data.

Implemented in GA_ElementGroup, GA_EdgeGroup, and GA_BreakpointGroup.

static bool GA_Group::jsonLoadDefinition ( UT_JSONParser p,
UT_WorkBuffer type,
UT_WorkBuffer name,
bool &  internal 
)
static

Load the GA_Group-Definition.

virtual bool GA_Group::jsonSaveData ( UT_JSONWriter w,
const GA_SaveMap map 
) const
pure virtual

Save the private group data.

Implemented in GA_ElementGroup, GA_EdgeGroup, and GA_BreakpointGroup.

bool GA_Group::jsonSaveDefinition ( UT_JSONWriter w,
const char *  type 
) const

Each group saves its data in a different format.

JSON Schema: GA_Group

The schema for a group consistes of an array of two entries. The first entry contains the definition of the group. The second is "private" data for the group.

{
"name" : "GA_Group",
"description" :
"A group is stored in an array of two items. The first
item stores the definition (or run information). The second
entry stores the private information for the group.",
"type" : "array",
"items" : [
{ "$ref" : "GA_Group-Definition" }, // Definition of primitive
{ "$ref" : "GA_Group-Data" }, // Single primitive data
],
}

JSON Schema: GA_Group-Definition

The group definition stores the information needed to create a group, but does not define the data associated with the group.

{
"name" : "GA_Group-Definition",
"description" : "Definition of a group",
"type" : "orderedmap",
"properties":
{
"type":
{
"type" : "string"
"description" : "Type of group (i.e. 'point')",
}
"name":
{
"type" : "string"
"description" : "Name of group",
}
"internal":
{
"type" : "boolean"
"description" : "Internal or externally visible group",
"optional" : true,
"default" : false,
}
},
}
virtual bool GA_Group::jsonShouldSave ( const GA_SaveMap map) const
virtual

Check to see whether group should be saved or not. The default behaviour checks the map options to see if the group should be saved (internal groups, specific types, etc.).

void GA_Group::setInternal ( bool  on_off)
inline

Definition at line 47 of file GA_Group.h.

virtual bool GA_Group::setName ( const UT_StringHolder n)
inlineprotectedvirtual

Only called by GA_GroupTable::rename(const char *, const char *). Though sub-classes can override the behaviour

Definition at line 184 of file GA_Group.h.

virtual bool GA_Group::stat ( UT_WorkBuffer info,
uint  level 
) const
virtual

Fill out information about the group. The default method fills does the following:

info.sprintf("%s::%s", groupType(classType()), getName());
memory = 0;

Reimplemented in GA_ElementGroup.

Friends And Related Function Documentation

friend class GA_GroupTable
friend

Definition at line 196 of file GA_Group.h.


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