2using System.Collections.Generic;
13 List<RawProto> m_rgItems =
new List<RawProto>();
27 get {
return m_rgItems.Count; }
37 get {
return m_rgItems[nIdx]; }
38 set { m_rgItems[nIdx] = value; }
48 m_rgItems.Insert(nIdx, p);
80 m_rgItems.Add(
new RawProto(strName, strVal,
null, type));
88 public void Add(
string strName,
string strVal)
90 m_rgItems.Add(
new RawProto(strName, strVal));
98 public void Add(
string strName,
object val)
103 m_rgItems.Add(
new RawProto(strName, val.ToString()));
112 public void Add<T>(
string strName, List<T> rg)
114 if (rg ==
null || rg.Count == 0)
119 string strVal = t.ToString();
121 if (typeof(T) == typeof(
string))
122 strVal =
"\"" + strVal +
"\"";
124 m_rgItems.Add(
new RawProto(strName, strVal));
135 return m_rgItems.Remove(p);
144 m_rgItems.RemoveAt(nIdx);
161 return m_rgItems.GetEnumerator();
168 System.Collections.IEnumerator
System.Collections.IEnumerable.GetEnumerator()
170 return m_rgItems.GetEnumerator();
The RawProtoCollection class is a list of RawProto objects.
void Add(string strName, object val)
Creates a new RawProto and adds it to this collection.
IEnumerator< RawProto > GetEnumerator()
Returns the enumerator for the collection.
bool Remove(RawProto p)
Removes a RawProto from the collection.
void Add(string strName, string strVal)
Creates a new RawProto and adds it to this collection.
void RemoveAt(int nIdx)
Removes the RawProto at a given index in the collection.
void Add(RawProto p)
Adds a RawProto to the collection.
void Insert(int nIdx, RawProto p)
Inserts a new RawProto into the collection at a given index.
RawProtoCollection()
The RawProtoCollection constructor.
void Add< T >(string strName, List< T > rg)
Creates a new RawProto for each element in rg and gives each the name strName, and add all to this co...
int Count
Returns the number of items in the collection.
void Add(string strName, string strVal, RawProto.TYPE type)
Creates a new RawProto and adds it to this collection.
void Clear()
Removes all items from the collection.
void Add(RawProtoCollection col)
Adds all elements of a RawProtoCollection to this collection.
The RawProto class is used to parse and output Google prototxt file data.
TYPE
Defines the type of a RawProto node.
The MyCaffe.basecode contains all generic types used throughout MyCaffe.