|
@@ -294,7 +294,7 @@ namespace FileManager
|
|
|
|
|
|
|
|
|
|
//typedef std::map<std::string, CollectionBase*>::iterator __declspec(dllexport) CollectionIterator; ???
|
|
//typedef std::map<std::string, CollectionBase*>::iterator __declspec(dllexport) CollectionIterator; ???
|
|
- public abstract class CollectionBase<T>
|
|
|
|
|
|
+ public abstract class CollectionBase<ISlo>
|
|
{
|
|
{
|
|
private string m_sCollectionName;
|
|
private string m_sCollectionName;
|
|
private string m_sCollectionClassType;
|
|
private string m_sCollectionClassType;
|
|
@@ -304,7 +304,7 @@ namespace FileManager
|
|
public SortedDictionary<ISlo, bool> m_mOwner = new SortedDictionary<ISlo, bool>(); //map<ISlo*, bool> ??
|
|
public SortedDictionary<ISlo, bool> m_mOwner = new SortedDictionary<ISlo, bool>(); //map<ISlo*, bool> ??
|
|
public void setCollectionName(string value) { m_sCollectionName = value; }
|
|
public void setCollectionName(string value) { m_sCollectionName = value; }
|
|
public void setCollectionClassType(string value) { m_sCollectionClassType = value; }
|
|
public void setCollectionClassType(string value) { m_sCollectionClassType = value; }
|
|
- public abstract T newElement();
|
|
|
|
|
|
+ public abstract ISlo newElement();
|
|
public string getCollectionName() { return m_sCollectionName; }
|
|
public string getCollectionName() { return m_sCollectionName; }
|
|
public int size() { return m_vCollection.Count(); }
|
|
public int size() { return m_vCollection.Count(); }
|
|
public ISlo getItem(int itemID) { return m_vCollection[itemID]; }
|
|
public ISlo getItem(int itemID) { return m_vCollection[itemID]; }
|
|
@@ -317,13 +317,13 @@ namespace FileManager
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public class Collection<T> : CollectionBase<T>
|
|
|
|
|
|
+ public class Collection<T> : CollectionBase<ISlo>
|
|
{
|
|
{
|
|
/**
|
|
/**
|
|
create new element of type T
|
|
create new element of type T
|
|
@return empty object of type T
|
|
@return empty object of type T
|
|
*/
|
|
*/
|
|
- public override T newElement()
|
|
|
|
|
|
+ public override ISlo newElement()
|
|
{
|
|
{
|
|
T newItem = System.Activator.CreateInstance<T>();
|
|
T newItem = System.Activator.CreateInstance<T>();
|
|
//T newItem = default(T);
|
|
//T newItem = default(T);
|
|
@@ -335,8 +335,8 @@ namespace FileManager
|
|
//I change this value to be false forever(gsp).No matter what case there's no need to set the object's owner to the collection
|
|
//I change this value to be false forever(gsp).No matter what case there's no need to set the object's owner to the collection
|
|
//after we created the object we'll put them to in a smartpointer.then the smartpointer will manage it.
|
|
//after we created the object we'll put them to in a smartpointer.then the smartpointer will manage it.
|
|
//m_mOwner[sIo] = false;//m_mOwner[newItem]=true
|
|
//m_mOwner[sIo] = false;//m_mOwner[newItem]=true
|
|
- Type type = newItem.GetType();
|
|
|
|
- return newItem;
|
|
|
|
|
|
+ //Type type = newItem.GetType();
|
|
|
|
+ return sIo;
|
|
}
|
|
}
|
|
|
|
|
|
public void addItem(T item)
|
|
public void addItem(T item)
|
|
@@ -363,7 +363,7 @@ namespace FileManager
|
|
|
|
|
|
//typedef std::vector<Slo*>::iterator __declspec(dllexport) SerializableIterator; //iterator?
|
|
//typedef std::vector<Slo*>::iterator __declspec(dllexport) SerializableIterator; //iterator?
|
|
|
|
|
|
- public class Slo<T> : ISlo
|
|
|
|
|
|
+ public class Slo : ISlo
|
|
{
|
|
{
|
|
//private (Slo const &s) { }
|
|
//private (Slo const &s) { }
|
|
//private Slo operator=(Slo const &s) { return *this; };
|
|
//private Slo operator=(Slo const &s) { return *this; };
|
|
@@ -383,7 +383,7 @@ namespace FileManager
|
|
public string m_sVersion;
|
|
public string m_sVersion;
|
|
public SortedDictionary<string, MemberBase> m_AttributeMappings = new SortedDictionary<string, MemberBase>();
|
|
public SortedDictionary<string, MemberBase> m_AttributeMappings = new SortedDictionary<string, MemberBase>();
|
|
public SortedDictionary<string, ISlo> m_MemberMappings = new SortedDictionary<string, ISlo>();
|
|
public SortedDictionary<string, ISlo> m_MemberMappings = new SortedDictionary<string, ISlo>();
|
|
- public SortedDictionary<string, CollectionBase<T>> m_MemberCollections = new SortedDictionary<string, CollectionBase<T>>();
|
|
|
|
|
|
+ public SortedDictionary<string, CollectionBase<ISlo>> m_MemberCollections = new SortedDictionary<string, CollectionBase<ISlo>>();
|
|
|
|
|
|
public void setClassName(string ClassName) { m_sClassName = ClassName; }
|
|
public void setClassName(string ClassName) { m_sClassName = ClassName; }
|
|
public Slo()
|
|
public Slo()
|
|
@@ -424,13 +424,12 @@ namespace FileManager
|
|
@SubclassCollection Collection to register
|
|
@SubclassCollection Collection to register
|
|
@return void
|
|
@return void
|
|
*/
|
|
*/
|
|
- public void Register(string CollectionName, CollectionBase<T> SubclassCollection)
|
|
|
|
|
|
+ public void Register(string CollectionName, CollectionBase<ISlo> SubclassCollection)
|
|
{
|
|
{
|
|
SubclassCollection.setCollectionName(CollectionName);
|
|
SubclassCollection.setCollectionName(CollectionName);
|
|
m_MemberCollections[CollectionName] = SubclassCollection;
|
|
m_MemberCollections[CollectionName] = SubclassCollection;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
public override void Serialize(bool isStoring, XmlDocument xml, XmlNode rootNode)
|
|
public override void Serialize(bool isStoring, XmlDocument xml, XmlNode rootNode)
|
|
{
|
|
{
|
|
if (isStoring)
|
|
if (isStoring)
|