libRoadRunner C API  1.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
rrArrayListItem.h
1 #ifndef rrArrayListItemH
2 #define rrArrayListItemH
3 #include "rrExporter.h"
4 #include "rrcStringList.h"
5 #include "rrArrayListItemBase.h"
6 
7 //This unit contains
8 // 1) a base class for ArrayListItems
9 // 2) Template for basic type ArrayListItems, such as int, char double etc.
10 // 3) An ArrayListItem class, that represent an ArrayList, within an ArrayList object
11 
12 namespace rrc
13 {
14 
20 template <class T>
22 {
23  private:
24  T mItemValue;
25 
26  public:
27  ArrayListItem(const T& val);
28 
29  virtual ~ArrayListItem(){}
30  operator T(){return mItemValue;}
31  virtual const char operator[](const int& pos) const {return '\0';} //Make sense for string types
32  ArrayListItem<T>& operator=(const ArrayListItem<T>& rhs);
33 };
34 
35 template<class T>
37 :
38 mItemValue(val)
39 {}
40 
41 template<class T>
42 ArrayListItem<T>& ArrayListItem<T>::operator=(const ArrayListItem<T>& rhs)
43 {
44  if(this != &rhs)
45  {
46  mItemValue = rhs.mItemValue;
47  }
48 
49  return *this;
50 }
51 
52 std::ostream& operator<<(std::ostream& stream, const ArrayListItemBase& item);
53 
54 }
55 #endif
Definition: _rrc_api.cpp:84
Definition: rrArrayListItem.h:21
Definition: rrArrayListItemBase.h:14