VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
rwFactoryItemList.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2021 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
12 #include "vrfutil/iteratorBase.h"
13 
14 
25 template <typename T>
27 {
28 public:
31 
34 
36  DtRwFactoryItemList(const DtString& name, DtReaderWriterRegistry* parentRegistry = NULL);
37  DtRwFactoryItemList(const DtSymbolString& name, DtReaderWriterRegistry* parentRegistry = NULL);
38 
42  DtReaderWriterRegistry* parentRegistry = NULL);
43 
45  DtReaderWriterRegistry* parentRegistry = NULL);
46 
49  DtReaderWriterRegistry* parentRegistry = NULL);
50 
52 
53  virtual ~DtRwFactoryItemList();
54 
55  DtlObjPtr getData(DtlObjPtr args, const DtReaderWriter::SearchPaths& searchPaths,
56  const DtVariableBindingsList& variableBindings);
57 
61  virtual DtListItem* add(T* data);
63  virtual DtListItem* addToStart(T* data);
65  virtual DtListItem* addToEnd(T* data);
66 
69  void removeAll();
70  void* remove(DtListItem* item);
71  void* remove(T* item);
72 
74  void removeAndDeleteAll();
75 
76  //virtual DtString prettyPrint() const;
77 
78  virtual void prePutSelf()
79  {
81  iterator iter(*this);
82  for (T* i = iter.first(); i; i = iter.next())
83  {
84  i->setName(i->type());
85  }
87  }
88 public:
89  void copyList(const DtRwFactoryItemList& orig);
90 
91 };
92 
93 #include "vrfutil/rwFactoryItemList.inl"
virtual void prePutSelf()
Called before either version of put self (file or environment). Default is no-op. ...
DtRwFactoryItemList & operator=(const DtRwFactoryItemList &orig)
Definition: symbolString.h:20
A Readable, Writable version of DtList. This class cannot be used directly, but must be inherited to ...
Definition: rwList.h:26
DtlObjPtr getData(DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings)
This method must be overridden by a subclass. Within this method, new instances of the DtReaderWriter...
virtual DtListItem * addToStart(T *data)
Inserts at front of list. Clones item added.
void removeAndDeleteAll()
Removes and deletes all entries in the list.
Definition: readerWriterRegistry.h:39
DtRwFactoryItemList()
default constructor
Description: DtIteratorBase is the base class for iterators used to iterate over a DtList...
Definition: iteratorBase.h:32
void removeAll()
Removes all entries from the list. If autoDelete is true, also deletes all items. ...
std::list< const DtRwVariableBindings * > DtVariableBindingsList
Definition: readerWriterRegistry.h:29
virtual T * first(bool move=true)
Definition: iteratorBase.h:331
std::vector< DtFilename > SearchPaths
Definition: readerWriter.h:92
DtIteratorBase< T > iterator
Definition: rwFactoryItemList.h:29
virtual T * next(bool move=true)
Definition: iteratorBase.h:332
virtual DtListItem * add(T *data)
Define this function to hide the DtRwList version, and accept only the specific DtReaderWriter subcla...
virtual void prePutSelf()
Called before either version of put self (file or environment). Default is no-op. ...
Definition: rwFactoryItemList.h:78
Templated RW list which contains items generated from a factory all sharing the same parent type...
Definition: rwFactoryItemList.h:26
void copyList(const DtRwFactoryItemList &orig)
virtual DtListItem * addToEnd(T *data)
Appends to end of list. Clones item added.
virtual DtSymbolString name() const
Accessor for name of this readable/writable object.
virtual ~DtRwFactoryItemList()
DtIteratorBase< const T > const_iterator
Definition: rwFactoryItemList.h:30

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)