Commit 74bc7e02 authored by Aivan_2008's avatar Aivan_2008
Browse files

Merge with MockCompsTest

--HG--
branch : DeploymentQt
......@@ -236,6 +236,9 @@
<CppCompile Include="..\..\..\Core\Engine\UBasePropCreatorMatrix.cpp">
<BuildOrder>130</BuildOrder>
</CppCompile>
<CppCompile Include="..\..\..\Core\Engine\UBasePropCreatorStd.cpp">
<BuildOrder>131</BuildOrder>
</CppCompile>
<CppCompile Include="..\..\..\Core\Engine\UBasePropCreatorTempl.cpp">
<BuildOrder>129</BuildOrder>
</CppCompile>
......@@ -1024,13 +1027,13 @@
<Operation>1</Operation>
</Platform>
</DeployClass>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
</Deployment>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
......
......@@ -27,6 +27,7 @@ DEFINES += RDK_CORE_VERSION=$$VERSION
SOURCES += \
../../../Core/Engine/UBasePropCreator.cpp \
../../../Core/Engine/UBasePropCreatorStd.cpp \
../../../Core/Engine/UBasePropCreatorMatrix.cpp \
../../../Core/Engine/UBasePropCreatorTempl.cpp \
../../../Core/Engine/UBasePropCreatorVector.cpp \
......@@ -161,6 +162,7 @@ SOURCES += \
HEADERS +=\
../../../Core/Engine/UBasePropCreator.h \
../../../Core/Engine/UBasePropCreatorStd.h \
../../../Core/Engine/UBasePropCreatorMatrix.h \
../../../Core/Engine/UBasePropCreatorTempl.h \
../../../Core/Engine/UBasePropCreatorVector.h \
......
......@@ -10,6 +10,4 @@ bool UBasePropCreator::BaseCrPropMock(RDK::USerStorageXML* serstorage, RDK::UMoc
return BaseCrPropMockTempl<UBasePropCreator>(serstorage,mock_unet);
}
}
......@@ -20,19 +20,6 @@ public:
// ,
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
static bool CreateSimpleTypeProperty(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet, unsigned int ptype);
// list
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
static void CreatePropertyList(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet, unsigned int ptype);
// std::pair
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
static void CreatePropertyPair(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet, unsigned int ptype);
// std::map
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
static void CreatePropertyMap(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet, unsigned int ptype);
};
......@@ -54,27 +41,6 @@ void UBasePropCreator::CreateProperty(RDK::USerStorageXML* serstorage, RDK::UMoc
return;
}
// list
if(type == "std::list")
{
CreatePropertyList<PropType, TypeInt>(serstorage,mock_unet, ptype);
return;
}
// pair
if(type == "std::pair")
{
CreatePropertyPair<PropType, TypeInt>(serstorage,mock_unet, ptype);
return;
}
// map
if(type == "std::map")
{
CreatePropertyMap<PropType, TypeInt>(serstorage,mock_unet, ptype);
return;
}
//UBMColorModel
if(type == "UBMColorModel")
{
......@@ -134,32 +100,17 @@ bool UBasePropCreator::CreateSimpleTypeProperty(RDK::USerStorageXML* serstorage,
CreatorProperty<PropType, TypeInt, bool>::CreatePropertyByType(serstorage, mock_unet, ptype);
return true;
}
if(type == typeid(char).name())
{
CreatorProperty<PropType, TypeInt, char>::CreatePropertyByType(serstorage, mock_unet, ptype);
return true;
}
if(type == typeid(unsigned char).name())
{
CreatorProperty<PropType, TypeInt, unsigned char>::CreatePropertyByType(serstorage, mock_unet, ptype);
return true;
}
if(type == typeid(short).name())
{
CreatorProperty<PropType, TypeInt, short>::CreatePropertyByType(serstorage, mock_unet, ptype);
return true;
}
if(type == typeid(unsigned short).name())
if(type == typeid(unsigned int).name())
{
CreatorProperty<PropType, TypeInt, unsigned short>::CreatePropertyByType(serstorage, mock_unet, ptype);
CreatorProperty<PropType, TypeInt, unsigned int>::CreatePropertyByType(serstorage, mock_unet, ptype);
return true;
}
if(type == typeid(int).name())
{
CreatorProperty<PropType, TypeInt, int>::CreatePropertyByType(serstorage, mock_unet, ptype);
return true;
}
if(type == typeid(unsigned int).name())
{
CreatorProperty<PropType, TypeInt, unsigned int>::CreatePropertyByType(serstorage, mock_unet, ptype);
return true;
......@@ -194,271 +145,10 @@ bool UBasePropCreator::CreateSimpleTypeProperty(RDK::USerStorageXML* serstorage,
CreatorProperty<PropType, TypeInt, double>::CreatePropertyByType(serstorage, mock_unet, ptype);
return true;
}
if(type == typeid(long double).name())
{
CreatorProperty<PropType, TypeInt, long double>::CreatePropertyByType(serstorage, mock_unet, ptype);
return true;
}
//throw ParseException("can't handle simple type: " + type);
return false;
}
// list
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
void UBasePropCreator::CreatePropertyList(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet, unsigned int ptype)
{
std::string prop_name = serstorage->GetNodeName();
int size=serstorage->GetNumNodes();
// - elemType
//
std::string type;
if(size == 0)
{
type = serstorage->GetNodeAttribute("elemType");
}
else
{
serstorage->SelectNode("elem",size-1);
type = serstorage->GetNodeAttribute("elemType");
serstorage->SelectUp();
}
if(type == typeid(bool).name())
{
CreatorProperty<PropType, TypeInt, std::list<bool> >::CreatePropertyByType(serstorage, mock_unet, ptype);
return;
}
if(type == typeid(char).name())
{
CreatorProperty<PropType, TypeInt, std::list<char> >::CreatePropertyByType(serstorage, mock_unet, ptype);
return;
}
if(type == typeid(unsigned char).name())
{
CreatorProperty<PropType, TypeInt, std::list<unsigned char> >::CreatePropertyByType(serstorage, mock_unet, ptype);
return;
}
if(type == typeid(short).name())
{
CreatorProperty<PropType, TypeInt, std::list<short> >::CreatePropertyByType(serstorage, mock_unet, ptype);
return;
}
if(type == typeid(unsigned short).name())
{
CreatorProperty<PropType, TypeInt, std::list<unsigned short> >::CreatePropertyByType(serstorage, mock_unet, ptype);
return;
}
if(type == typeid(int).name())
{
CreatorProperty<PropType, TypeInt, std::list<int> >::CreatePropertyByType(serstorage, mock_unet, ptype);
return;
}
if(type == typeid(unsigned int).name())
{
CreatorProperty<PropType, TypeInt, std::list<unsigned int> >::CreatePropertyByType(serstorage, mock_unet, ptype);
return;
}
if(type == typeid(long).name())
{
CreatorProperty<PropType, TypeInt, std::list<long> >::CreatePropertyByType(serstorage, mock_unet, ptype);
return;
}
if(type == typeid(unsigned long).name())
{
CreatorProperty<PropType, TypeInt, std::list<unsigned long> >::CreatePropertyByType(serstorage, mock_unet, ptype);
return;
}
if(type == typeid(long long).name())
{
CreatorProperty<PropType, TypeInt, std::list<long long> >::CreatePropertyByType(serstorage, mock_unet, ptype);
return;
}
if(type == typeid(unsigned long long).name())
{
CreatorProperty<PropType, TypeInt, std::list<unsigned long long> >::CreatePropertyByType(serstorage, mock_unet, ptype);
return;
}
if(type == typeid(float).name())
{
CreatorProperty<PropType, TypeInt, std::list<float> >::CreatePropertyByType(serstorage, mock_unet, ptype);
return;
}
if(type == typeid(double).name())
{
CreatorProperty<PropType, TypeInt, std::list<double> >::CreatePropertyByType(serstorage, mock_unet, ptype);
return;
}
if(type == typeid(long double).name())
{
CreatorProperty<PropType, TypeInt, std::list<long double> >::CreatePropertyByType(serstorage, mock_unet, ptype);
return;
}
}
// std::pair
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
void UBasePropCreator::CreatePropertyPair(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet, unsigned int ptype)
{
std::string prop_name = serstorage->GetNodeName();
int size=serstorage->GetNumNodes();
if(size!=2)
return;
std::string first_type;
std::string second_type;
serstorage->SelectNode("first");
first_type = serstorage->GetNodeAttribute("Type");
serstorage->SelectUp();
serstorage->SelectNode("second");
second_type = serstorage->GetNodeAttribute("Type");
serstorage->SelectUp();
if(first_type == "std::string")
{
if(second_type == "std::string")
{
CreatorProperty<PropType, TypeInt, std::pair<std::string,std::string> >::CreatePropertyByType(serstorage, mock_unet, ptype);
return;
}
if(second_type == typeid(int).name())
{
CreatorProperty<PropType, TypeInt, std::pair<std::string,int> >::CreatePropertyByType(serstorage, mock_unet, ptype);
return;
}
if(second_type == typeid(bool).name())
{
CreatorProperty<PropType, TypeInt, std::pair<std::string,bool> >::CreatePropertyByType(serstorage, mock_unet, ptype);
return;
}
}
if(second_type == "std::string")
{
if(first_type == typeid(int).name())
{
CreatorProperty<PropType, TypeInt, std::pair<int,std::string> >::CreatePropertyByType(serstorage, mock_unet, ptype);
return;
}
}
if(first_type == typeid(int).name())
{
if(second_type == "UColorT")
{
CreatorProperty<PropType, TypeInt, std::pair<int,UColorT> >::CreatePropertyByType(serstorage, mock_unet, ptype);
return;
}
}
if(first_type == typeid(double).name())
{
if(second_type == typeid(int).name())
{
CreatorProperty<PropType, TypeInt, std::pair<double,int> >::CreatePropertyByType(serstorage, mock_unet, ptype);
return;
}
}
}
// std::map
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
void UBasePropCreator::CreatePropertyMap(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet, unsigned int ptype)
{
std::string prop_name = serstorage->GetNodeName();
std::string first_type;
std::string second_type;
int size=serstorage->GetNumNodes();
//
if(serstorage->SelectNode("elem",size-1))
{
size=serstorage->GetNumNodes();
if(size!=2)
{
serstorage->SelectUp();
return;
}
serstorage->SelectNode("first");
first_type = serstorage->GetNodeAttribute("Type");
serstorage->SelectUp();
serstorage->SelectNode("second");
second_type = serstorage->GetNodeAttribute("Type");
serstorage->SelectUp();
serstorage->SelectUp();
}
else
{
first_type = serstorage->GetNodeAttribute("firstType");
second_type = serstorage->GetNodeAttribute("secondType");
}
if(first_type == "std::string")
{
if(second_type == "std::string")
{
CreatorProperty<PropType, TypeInt, std::map<std::string,std::string> >::CreatePropertyByType(serstorage, mock_unet, ptype);
return;
}
if(second_type == typeid(int).name())
{
CreatorProperty<PropType, TypeInt, std::map<std::string,int> >::CreatePropertyByType(serstorage, mock_unet, ptype);
return;
}
if(second_type == typeid(bool).name())
{
CreatorProperty<PropType, TypeInt, std::map<std::string,bool> >::CreatePropertyByType(serstorage, mock_unet, ptype);
return;
}
if(second_type.find("MDVector",0) == 0)
{
// MDVector
size_t pos = second_type.find("MDVector");
if (pos != std::string::npos)
{
second_type.erase(pos, std::string("MDVector").length());
}
// '<' '>'
second_type.erase(std::remove(second_type.begin(), second_type.end(), '>'), second_type.end());
second_type.erase(std::remove(second_type.begin(), second_type.end(), '<'), second_type.end());
std::string matrix_type = second_type;
if(matrix_type == typeid(int).name())
{
CreatorProperty<PropType, TypeInt, MDVector<int> >::CreatePropertyByType(serstorage, mock_unet, ptype);
return;
}
}
}
if(first_type == typeid(int).name())
{
if(second_type == "UColorT")
{
CreatorProperty<PropType, TypeInt, std::map<int,UColorT> >::CreatePropertyByType(serstorage, mock_unet, ptype);
return;
}
if(second_type == "std::string")
{
CreatorProperty<PropType, TypeInt, std::map<int,std::string> >::CreatePropertyByType(serstorage, mock_unet, ptype);
return;
}
}
}
}
#endif // UBASEPROPCREATOR_H
......@@ -202,76 +202,11 @@ void UBasePropCreatorMatrix::CreatePropertyVectorOfMDMatrix(RDK::USerStorageXML*
type.erase(std::remove(type.begin(), type.end(), '>'), type.end());
type.erase(std::remove(type.begin(), type.end(), '<'), type.end());
if(type == typeid(bool).name())
{
CreatorProperty<PropType, TypeInt, MDVector<bool> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
if(type == typeid(char).name())
{
CreatorProperty<PropType, TypeInt, MDVector<char> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
if(type == typeid(unsigned char).name())
{
CreatorProperty<PropType, TypeInt, MDVector<unsigned char> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
if(type == typeid(short).name())
{
CreatorProperty<PropType, TypeInt, MDVector<short> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
if(type == typeid(unsigned short).name())
{
CreatorProperty<PropType, TypeInt, MDVector<unsigned short> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
if(type == typeid(int).name())
{
CreatorProperty<PropType, TypeInt, MDVector<int> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
if(type == typeid(unsigned int).name())
{
CreatorProperty<PropType, TypeInt, MDVector<unsigned int> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
if(type == typeid(long).name())
{
CreatorProperty<PropType, TypeInt, MDVector<long> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
if(type == typeid(unsigned long).name())
{
CreatorProperty<PropType, TypeInt, MDVector<unsigned long> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
if(type == typeid(long long).name())
{
CreatorProperty<PropType, TypeInt, MDVector<long long> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
if(type == typeid(unsigned long long).name())
{
CreatorProperty<PropType, TypeInt, MDVector<unsigned long long> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
if(type == typeid(float).name())
{
CreatorProperty<PropType, TypeInt, MDVector<float> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
if(type == typeid(double).name())
{
CreatorProperty<PropType, TypeInt, MDVector<double> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
if(type == typeid(long double).name())
{
CreatorProperty<PropType, TypeInt, MDVector<long double> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
}
// MDMatrix
......@@ -293,76 +228,16 @@ void UBasePropCreatorMatrix::CreatePropertyMDMatrix(RDK::USerStorageXML* serstor
std::string matrix_type = type;
if(type == typeid(bool).name())
{
CreatorProperty<PropType, TypeInt, MDMatrix<bool> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
if(type == typeid(char).name())
{
CreatorProperty<PropType, TypeInt, MDMatrix<char> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
if(type == typeid(unsigned char).name())
{
CreatorProperty<PropType, TypeInt, MDMatrix<unsigned char> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
if(type == typeid(short).name())
{
CreatorProperty<PropType, TypeInt, MDMatrix<short> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
if(type == typeid(unsigned short).name())
{
CreatorProperty<PropType, TypeInt, MDMatrix<unsigned short> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
if(type == typeid(int).name())
{
CreatorProperty<PropType, TypeInt, MDMatrix<int> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
if(type == typeid(unsigned int).name())
{
CreatorProperty<PropType, TypeInt, MDMatrix<unsigned int> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
if(type == typeid(long).name())
{
CreatorProperty<PropType, TypeInt, MDMatrix<long> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
if(type == typeid(unsigned long).name())
{
CreatorProperty<PropType, TypeInt, MDMatrix<unsigned long> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
if(type == typeid(long long).name())
{
CreatorProperty<PropType, TypeInt, MDMatrix<long long> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
if(type == typeid(unsigned long long).name())
{
CreatorProperty<PropType, TypeInt, MDMatrix<unsigned long long> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
if(type == typeid(float).name())
{
CreatorProperty<PropType, TypeInt, MDMatrix<float> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
if(type == typeid(double).name())
{
CreatorProperty<PropType, TypeInt, MDMatrix<double> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
if(type == typeid(long double).name())
{
CreatorProperty<PropType, TypeInt, MDMatrix<long double> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
}
// MDVector
......@@ -384,76 +259,16 @@ void UBasePropCreatorMatrix::CreatePropertyMDVector(RDK::USerStorageXML* serstor
std::string matrix_type = type;
if(type == typeid(bool).name())
{
CreatorProperty<PropType, TypeInt, MDVector<bool> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
if(type == typeid(char).name())
{
CreatorProperty<PropType, TypeInt, MDVector<char> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
if(type == typeid(unsigned char).name())
{
CreatorProperty<PropType, TypeInt, MDVector<unsigned char> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
if(type == typeid(short).name())
{
CreatorProperty<PropType, TypeInt, MDVector<short> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
if(type == typeid(unsigned short).name())
{
CreatorProperty<PropType, TypeInt, MDVector<unsigned short> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
if(type == typeid(int).name())
{
CreatorProperty<PropType, TypeInt, MDVector<int> >::CreatePropertyByType(serstorage,mock_unet, ptype);
return;
}
if(type == typeid(unsigned int).name())
{
CreatorProperty<PropType, TypeInt, MDVector<unsigned int> >::CreatePropertyByType(serstorage,mock_unet, ptype);