VR-Forces 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() override;
54 
55  virtual DtlObjPtr getData(DtlObjPtr args, const DtReaderWriter::SearchPaths& searchPaths,
56  const DtVariableBindingsList& variableBindings) override;
57 
61  virtual DtListItem* add(T* data);
63  virtual DtListItem* addToStart(T* data);
65  virtual DtListItem* addToEnd(T* data);
66 
69  virtual void removeAll() override;
70  void* remove(DtListItem* item);
71  void* remove(T* item);
72 
74  virtual void removeAndDeleteAll() override;
75 
76  //virtual DtString prettyPrint() const;
77 
78  virtual void prePutSelf() override
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)
virtual ~DtRwFactoryItemList() override
This class allows one to collect and compare strings using an index number instead of having to do st...
Definition: symbolString.h:27
virtual void removeAll() override
Removes all entries from the list. If autoDelete is true, also deletes all items. ...
A Readable, Writable version of DtList. This class cannot be used directly, but must be inherited to ...
Definition: rwList.h:26
virtual DtListItem * addToStart(T *data)
Inserts at front of list. Clones item added.
virtual DtlObjPtr getData(DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings) override
This method must be overridden by a subclass. Within this method, new instances of the DtReaderWriter...
Definition: readerWriterRegistry.h:39
DtRwFactoryItemList()
default constructor
virtual void removeAndDeleteAll() override
Removes and deletes all entries in the list.
Description: DtIteratorBase is the base class for iterators used to iterate over a DtList...
Definition: iteratorBase.h:32
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...
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 void prePutSelf() override
Called before either version of put self (file or environment). Default is no-op. ...
Definition: rwFactoryItemList.h:78
virtual DtSymbolString name() const
Accessor for name of this readable/writable object.
DtIteratorBase< const T > const_iterator
Definition: rwFactoryItemList.h:30

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)