VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
DtRwIntrusiveList Class Referenceabstract

class DtRwIntrusiveList:

Instances of DtRwIntrusiveList are readable-writable versions of the VR-Link DtIntrusiveList class. Instead of expecting its objects to be derived from DtListedObj, this class expects them to be derived from DtRwListedObj.

In order to use this class, you will have to derive a more specific class from it that implements the special getData function to create the actual list items.

The save format for this class is something like: (list-name (list-elem-name ...element putSelf data...) (list-elem-name ...element putSelf data...) ... )

Inheritance diagram for DtRwIntrusiveList:
Inheritance graph
[legend]

Public Member Functions

 DtRwIntrusiveList ()
 
 DtRwIntrusiveList (const DtString &name, DtReaderWriterRegistry *parentRegistry=NULL)
 
 DtRwIntrusiveList (const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=NULL)
 
 DtRwIntrusiveList (const DtString &name, const DtRwIntrusiveList &orig, DtReaderWriterRegistry *parentRegistry=NULL)
 
 DtRwIntrusiveList (const DtSymbolString &name, const DtRwIntrusiveList &orig, DtReaderWriterRegistry *parentRegistry=NULL)
 
virtual ~DtRwIntrusiveList ()
 
DtRwIntrusiveListoperator= (const DtRwIntrusiveList &orig)
 
DtRwListedObjfirstObj () const
 
DtRwListedObjlastObj () const
 
DtListItem * first () const
 
DtListItem * last () const
 
unsigned count () const
 
DtListItem * add (DtRwListedObj *data)
 
DtListItem * addToStart (DtRwListedObj *data)
 
DtListItem * addToEnd (DtRwListedObj *data)
 
DtListItem * addBefore (DtRwListedObj *data, DtRwListedObj *before)
 
DtListItem * addAfter (DtRwListedObj *data, DtRwListedObj *after)
 
DtRwListedObjremove (DtRwListedObj *data)
 
virtual DtRwListedObjremove (DtListItem *item)
 
void removeAndDelete (DtRwListedObj *data)
 
virtual void removeAndDelete (DtListItem *item)
 
virtual void removeAll ()
 
virtual void removeAllAndDelete ()
 
DtListItem * itemLookup (DtRwListedObj *data) const
 
virtual void getSelf (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings)
 
virtual DtlObjPtr getData (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings)=0
 
virtual DtlObjPtr getLocalData (DtlObjPtr args)
 
virtual const charreaderWriterType () const
 
- Public Member Functions inherited from DtReaderWriter
 DtReaderWriter ()
 
 DtReaderWriter (const DtString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false)
 
 DtReaderWriter (const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false)
 
 DtReaderWriter (const DtString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL)
 
 DtReaderWriter (const DtSymbolString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL)
 
 DtReaderWriter (const DtReaderWriter &, DtReaderWriterRegistry *parentRegistry=NULL)
 
const DtReaderWriteroperator= (const DtReaderWriter &orig)
 
bool operator== (const DtReaderWriter &) const
 
bool operator!= (const DtReaderWriter &rhs)
 
virtual ~DtReaderWriter ()
 
virtual void putSelf (std::string &fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
 
virtual void postPutSelf ()
 
virtual void prePutSelf ()
 
virtual void postGetSelf ()
 
virtual void preGetSelf ()
 
virtual void writeSelf (std::string &fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
 
virtual DtSymbolString name () const
 
virtual void addAlias (const DtSymbolString &alias)
 
virtual void addAlias (const DtString &alias)
 
virtual bool hasAlias (const DtSymbolString &alias)
 
virtual const aliasContaineraliases () const
 
virtual void setReadonly (bool flag)
 
bool isReadonly () const
 
virtual void reset ()
 
virtual int alignment () const
 
virtual bool variableIsBound () const
 
virtual void unbindVariable ()
 
virtual void setName (const DtString &)
 
virtual const charxmlType () const
 
virtual DtString prettyPrint () const
 
std::string debugText () const
 
virtual void bindVariables (DtVariableBindingsList variableBindings)
 
virtual std::list
< DtVariableNameType
unboundVariables () const
 
bool invalid () const
 
virtual bool hasChild (const DtReaderWriter *p) const
 
virtual bool hasVariableReference () const
 
virtual void bindLocalVariables (const DtVariableBindingsList &variableBindings)
 
virtual void recordUpdateTime () const
 
virtual bool wasUpdatedSince (DtTime t) const
 
virtual bool changedSinceLastChecked ()
 
virtual bool peekChangedSinceLastChecked () const
 
virtual void putData (std::string &fp, int indentLevel=0)
 
virtual void setValueSpecified (bool specified, bool recurse=false)
 
virtual bool valueSpecified () const
 
virtual bool isVariableReference () const
 
virtual void setIsVariableReference (bool value)
 
virtual void clearAllVariableReferenceFlags ()
 
virtual DtSymbolString variableName () const
 
virtual void setVariableName (const DtSymbolString variableName)
 
virtual const DtReaderWriterdefaultRWValue () const
 
virtual DtReaderWriterdefaultRWValue ()
 
virtual void setDefaultRWValue (DtReaderWriter *)
 
virtual bool checkAndSetDefaultRWValue (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &variableBindings=nullVariableReference())
 
const DtReaderWriterRegistryregistry () const
 
DtReaderWriterRegistryregistry ()
 
virtual DtPropertyInterfaceproperty ()
 
virtual const DtPropertyInterfaceproperty () const
 
virtual DtString toXml () const
 
virtual DtRwVariableBindingsgenerateVariableBindings () const
 
virtual bool toXml (const DtFilename &) const
 
virtual bool fromXml (const DtString &)
 
virtual bool fromXmlFile (const DtFilename &)
 
virtual void putSelf (DtEnvironmentSP, DtEnvValueSP parent) const
 
virtual void putData (DtEnvironmentSP, DtEnvValueSP value) const
 
virtual void putVariableReference (DtEnvironmentSP, DtEnvValueSP value) const
 
virtual void getSelf (const DtEnvironmentSP, const DtEnvValueSP root, const SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &bindings=DtVariableBindingsList())
 
virtual void getData (const DtEnvironmentSP, const DtEnvValueSP, const SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &bindings=DtVariableBindingsList())
 
virtual void unrecognizedItem (const DtEnvironmentSP env, const DtEnvValueSP root, const SearchPaths &searchPaths, const DtVariableBindingsList &varBindings)
 
virtual void getVariableReference (DtEnvironmentSP, DtEnvValueSP value)
 

Protected Member Functions

 DtRwIntrusiveList (const DtRwIntrusiveList &orig)
 
virtual DtListItem * addToList (DtRwListedObj *data, DtRwListedObj *after)
 
- Protected Member Functions inherited from DtReaderWriter
virtual void bindToRwAsVariable (const DtReaderWriter *rw)
 

Protected Attributes

DtList myList
 
- Protected Attributes inherited from DtReaderWriter
const DtSymbolString myName
 
DtReaderWriterRegistry myRegistry
 
DtReaderWriterRegistrymyParentRegistry
 
bool myValueSpecified
 
bool myReadOnlyFlag
 
bool myIsVariableReference
 
DtSymbolString myVariableName
 
bool myVariableIsBound
 
DtReaderWritermyDefaultValue
 
aliasContainer myAliases
 
bool myInvalid
 
bool myChangedFlag
 

Additional Inherited Members

- Public Types inherited from DtReaderWriter
typedef std::vector
< DtSymbolString
aliasContainer
 
typedef std::vector
< DtSymbolString >::iterator 
aliasIter
 
typedef std::vector
< DtSymbolString >
::const_iterator 
aliasConstIter
 
typedef std::vector< DtFilename > SearchPaths
 
typedef std::pair
< DtSymbolString, DtString
DtVariableNameType
 
typedef DtReaderWriterFactory *(* DtReaderWriterFactoryCreatorFcn )()
 
- Static Public Member Functions inherited from DtReaderWriter
static void putIndent (std::string &fp, int indentLevel)
 
static const
DtVariableBindingsList
nullVariableReference ()
 
static void setPostGetSelfCallback (DtGetSelfCallbackFcn fcn, void *usrData)
 
static void setPrePutSelfCallback (DtPutSelfCallbackFcn fcn, void *usrData)
 
static void setPutIndent (bool)
 
static bool putIndent ()
 
static const chartheXmlType ()
 
static const DtFilename & appPath ()
 
static void setFactoryCreatorFunction (DtReaderWriterFactoryCreatorFcn fcn)
 
static void createReaderWriterFactory ()
 
static void cleanupFactory ()
 
static DtReaderWriterFactoryfactory ()
 
static void setOutputStream (DtOutputStream *stream)
 
static DtOutputStream & outputStream ()
 
static DtReaderWritercreateFromXmlFile (const DtFilename &, bool createAsProperty=false)
 
static DtReaderWritercreateFromXml (const DtString &, bool createAsProperty=false)
 
static DtReaderWritercreateFromEnvironment (DtEnvironmentSP, bool createAsProperty=false)
 
static DtString getAttribute (DtEnvironmentSP env, const DtString &name, DtEnvValueSP root)
 
- Static Protected Attributes inherited from DtReaderWriter
static DtString theUnspecifiedValue
 
static DtGetSelfCallbackInfo thePostGetSelfCallback
 
static DtPutSelfCallbackInfo thePrePutSelfCallback
 
static const DtVariableBindingsList theEmptyVariableBindingsList
 
static bool theCreatorFcnSet
 
static DtReaderWriterFactorytheFactory
 
static
DtReaderWriterFactoryCreatorFcn 
theFactoryCreatorFcn
 
static bool thePutIndent
 
static DtOutputStream * theOutputStream
 

Constructor & Destructor Documentation

DtRwIntrusiveList::DtRwIntrusiveList ( )

default constructor

DtRwIntrusiveList::DtRwIntrusiveList ( const DtString name,
DtReaderWriterRegistry parentRegistry = NULL 
)

real constructor

DtRwIntrusiveList::DtRwIntrusiveList ( const DtSymbolString name,
DtReaderWriterRegistry parentRegistry = NULL 
)
DtRwIntrusiveList::DtRwIntrusiveList ( const DtString name,
const DtRwIntrusiveList orig,
DtReaderWriterRegistry parentRegistry = NULL 
)

Invokes DtReaderWriter copy constructor. Elements are not copied.

DtRwIntrusiveList::DtRwIntrusiveList ( const DtSymbolString name,
const DtRwIntrusiveList orig,
DtReaderWriterRegistry parentRegistry = NULL 
)
virtual DtRwIntrusiveList::~DtRwIntrusiveList ( )
virtual

destructor Note: for consistency with other list classes, this destructor will NOT delete the data objects contained by the list. If you wish to have the data deleted as well, call removeAllAndDelete() before deleting the entire list.

DtRwIntrusiveList::DtRwIntrusiveList ( const DtRwIntrusiveList orig)
protected

C++ copy constructor Not implemented, do not call.

Member Function Documentation

DtRwIntrusiveList& DtRwIntrusiveList::operator= ( const DtRwIntrusiveList orig)

Calls down to DtReaderWriter::operator=(). List elements are not copied.

DtRwListedObj * DtRwIntrusiveList::firstObj ( ) const
inline

Return first and last item on the list.

Inline Functions.

References myList.

Referenced by addToStart(), and DtSimBlock::firstStmt().

DtRwListedObj * DtRwIntrusiveList::lastObj ( ) const
inline

References myList.

Referenced by addToEnd(), and DtSimBlock::lastStmt().

DtListItem * DtRwIntrusiveList::first ( ) const
inline

Return first and last item on the list. DtListItem is an envelope for your data. The data can be obtained using DtListItem::data().

References myList.

Referenced by addToStart().

DtListItem * DtRwIntrusiveList::last ( ) const
inline

References myList.

Referenced by addToEnd().

unsigned DtRwIntrusiveList::count ( ) const
inline

Returns the number of elements in the list.

References myList.

DtListItem * DtRwIntrusiveList::add ( DtRwListedObj data)
inline

Add element to the end of the list. Returns the DtListItem envelope object that contains your new element.

References addToEnd().

DtListItem * DtRwIntrusiveList::addToStart ( DtRwListedObj data)
inline

Add element to the beginning of the list. Returns the DtListItem envelope object that contains your new element.

References addBefore(), first(), firstObj(), and myList.

DtListItem * DtRwIntrusiveList::addToEnd ( DtRwListedObj data)
inline

Add element to the end of the list. Returns the DtListItem envelope object that contains your new element.

References addToList(), last(), lastObj(), and myList.

Referenced by add().

DtListItem * DtRwIntrusiveList::addBefore ( DtRwListedObj data,
DtRwListedObj before 
)
inline

Add element to the list just before the indicated object. Returns the DtListItem envelope object that contains your new element.

References addToList(), and DtRwListedObj::prev().

Referenced by addToStart().

DtListItem * DtRwIntrusiveList::addAfter ( DtRwListedObj data,
DtRwListedObj after 
)
inline

Add element to the list just after the indicated object. Returns the DtListItem envelope object that contains your new element.

References addToList().

DtRwListedObj * DtRwIntrusiveList::remove ( DtRwListedObj data)
inline

Remove an element from the list. Note: remove does not free memory of data associated with the item. It only frees the item. The data is returned to the caller for deletion if required.

References DtRwListedObj::myItem.

virtual DtRwListedObj* DtRwIntrusiveList::remove ( DtListItem *  item)
virtual

Remove an element from the list. Item is the envelope containing the data element you would like to remove. Note: remove does not free memory of data associated with the item. It only frees the item. The data is returned to the caller for deletion if required.

void DtRwIntrusiveList::removeAndDelete ( DtRwListedObj data)
inline

Remove and delete an element from the list.

References DtRwListedObj::myItem.

virtual void DtRwIntrusiveList::removeAndDelete ( DtListItem *  item)
virtual

Remove and delete an element from the list. Item is the envelope containing the data element you would like to remove.

virtual void DtRwIntrusiveList::removeAll ( )
virtual

Calls remove for all elements in the list. It does NOT delete the data in the list. Merely removes the data from the list.

virtual void DtRwIntrusiveList::removeAllAndDelete ( )
virtual

Same as removeAll, except that this DOES delete the data in the list.

DtListItem * DtRwIntrusiveList::itemLookup ( DtRwListedObj data) const
inline

Returns the DtListItem envelope object containing the indicated data element. This function should never be necessary, it is included solely for completeness and consistency with DtIntrusiveList.

References myList.

virtual void DtRwIntrusiveList::getSelf ( DtlObjPtr  args,
const DtReaderWriter::SearchPaths searchPaths,
const DtVariableBindingsList variableBindings 
)
virtual

Reads the contents of the list, using the list-specific getData function below.

Reimplemented from DtReaderWriter.

virtual DtlObjPtr DtRwIntrusiveList::getData ( DtlObjPtr  args,
const DtReaderWriter::SearchPaths searchPaths,
const DtVariableBindingsList variableBindings 
)
pure virtual

This special version of getData needs to create the necessary list element object (one that's derived from DtRwListedObj), tell the element to getSelf, and then add the element to the DtRwIntrusiveList. The return value is ignored.

Reimplemented from DtReaderWriter.

Implemented in DtSimBlock.

virtual DtlObjPtr DtRwIntrusiveList::getLocalData ( DtlObjPtr  args)
virtual

Since getData is usually used for local data, and we're overloading it here to get the list data, use this if you want any data before your lists.

virtual const char* DtRwIntrusiveList::readerWriterType ( ) const
virtual

Used to supply a string type that this reader writer type is. This can be used in place of dynamic-casting. Also used by the opd editor to determine which type of control to create.

Reimplemented from DtReaderWriter.

virtual DtListItem* DtRwIntrusiveList::addToList ( DtRwListedObj data,
DtRwListedObj after 
)
protectedvirtual

Add element to the list just after the indicated item. Returns the DtListItem envelope object that contains your new element.

Reimplemented in DtSimBlock.

Referenced by addAfter(), addBefore(), and addToEnd().

Member Data Documentation

DtList DtRwIntrusiveList::myList
protected

The actual DtList used to store the items.

Referenced by addToEnd(), addToStart(), count(), first(), firstObj(), itemLookup(), last(), and lastObj().


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

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)