class TaggedObjectStorage


Inheritance:


Public Methods

TaggedObjectStorage()
virtual ~TaggedObjectStorage()
virtual int setSize(int newSize)
virtual bool addComponent(TaggedObject *newComponent)
virtual TaggedObject* removeComponent(int tag)
virtual int getNumComponents(void) const
virtual TaggedObject* getComponentPtr(int tag)
virtual TaggedObjectIter& getComponents(void)
virtual TaggedObjectStorage* getEmptyCopy(void)
virtual void clearAll(bool invokeDestructors = true)
virtual void Print(ostream &s, int flag =0)

Documentation

TaggedObjectStorage is used as a container object to store and provide access to objects of type TaggedObject. Each TaggedObject object stored in a TaggedObjectStorage object must have a unique integer tag to distinguish it from other the other objects stored. The TaggedObjectStorage class is an abstract base class, it just defines the interface all concrete subclasses must provide. The interface defines methods to add and to remove the components, and methods to obtain access to the components.

TaggedObjectStorage()

Does nothing

virtual ~TaggedObjectStorage()

Does nothing. Provided so that the concrete subclasses destructor will be invoked. The subclasses destructor is NOT to delete the objects stored in the object. clearAll() can be invoked by the programmer if this is required.

virtual int setSize(int newSize)

To provide an indication to the container object that newSize components are likely to be added. This is only a hint, it should be acceptable for more or less objects than newSize to be added to the container.

virtual bool addComponent(TaggedObject *newComponent)

To add the object newComponent to the container. To return true if the object was added to the container, false otherwise. The object should not be added if another object with a similar tag already exists in the container.

virtual TaggedObject* removeComponent(int tag)

To remove the component whose tag is given by tag from the container. To return a pointer to the removed object if successful, 0 if not.

virtual int getNumComponents(void) const

To return the number of components currently stored in the container

virtual TaggedObject* getComponentPtr(int tag)

To return a pointer to the TaggedObject whose identifier is given by tag. If the object has not been added to the container 0 is to be returned.

virtual TaggedObjectIter& getComponents(void)

To return an iter for iterating through the objects that have been added to the container

virtual TaggedObjectStorage* getEmptyCopy(void)

To return an empty copy of the container

virtual void clearAll(bool invokeDestructors = true)

To remove all objects from the container and to invoke the destructor on these objects if invokeDestructor is true

virtual void Print(ostream &s, int flag =0)

To invoke Print(s,flag) on all objects which have been added to the container.


Direct child classes:
ArrayOfTaggedObjects

alphabetic index Contents

this page has been generated automatically by a slightly modified version of doc++ for OpenSees

Copyright Contact Us