Commit 447c4bed authored by vlad_burin's avatar vlad_burin
Browse files

Removed unnecessary comments.

Some template syntax added for app build Qt C++11

--HG--
branch : MockCompsTest
parent 50371e5d2a69
......@@ -20,51 +20,11 @@ public:
// ,
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
static bool CreateSimpleTypeProperty(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet);
/*
//
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
static void CreatePropertyVector(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet);
// (simpleVector)
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
static void CreatePropertySimpleVector(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet);
// std::vector<simpleVector> >
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
static void CreatePropertyVectorOfSimVec(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet);
//
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
static void CreatePropertyVectorOfPair(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet);
// MVector<T>
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
static void CreatePropertyVectorOfMVector(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet);
// MDMatrix<T>
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
static void CreatePropertyVectorOfMDMatrix(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet);
*/
// list
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
static void CreatePropertyList(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet);
/*
// MDMatrix
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
static void CreatePropertyMDMatrix(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet);
// MDVector
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
static void CreatePropertyMDVector(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet);
// MVector size - 2,3,4 - double
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
static void CreatePropertyMVector(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet);
// MMatrix [rows,cols] - [3,3][4,4] - double, int, bool
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
static void CreatePropertyMMatrix(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet);
*/
// std::pair
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
static void CreatePropertyPair(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet);
......@@ -158,35 +118,7 @@ void UBasePropCreator::CreateProperty(RDK::USerStorageXML* serstorage, RDK::UMoc
return;
}
*/
/*
// MDMatrix
if(type.find("MDMatrix",0) == 0)
{
CreatePropertyMDMatrix<PropType, TypeInt>(serstorage,mock_unet);
return;
}
// MDVector
if(type.find("MDVector",0) == 0)
{
CreatePropertyMDVector<PropType, TypeInt>(serstorage,mock_unet);
return;
}
//#ifndef __BORLANDC__ // TODO: ( ?)
// MVector
if(type.find("MVector",0) == 0)
{
CreatePropertyMVector<PropType, TypeInt>(serstorage,mock_unet);
return;
}
// MMatrix
if(type.find("MMatrix",0) == 0)
{
CreatePropertyMMatrix<PropType, TypeInt>(serstorage,mock_unet);
return;
}
//#endif */
}
// ,
......@@ -272,157 +204,6 @@ bool UBasePropCreator::CreateSimpleTypeProperty(RDK::USerStorageXML* serstorage,
}
/*
// MVector<T>
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
void UBasePropCreator::CreatePropertyVectorOfMVector(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet)
{
std::string prop_name = serstorage->GetNodeName();
if(!(serstorage->SelectNode("elem")))
return;
std::string type = serstorage->GetNodeAttribute("Type");
int size= RDK::atoi(serstorage->GetNodeAttribute("Size"));
// MVector
size_t pos = type.find("MVector");
if (pos != std::string::npos)
{
type.erase(pos, std::string("MVector").length());
}
// '<' '>'
type.erase(std::remove(type.begin(), type.end(), '>'), type.end());
type.erase(std::remove(type.begin(), type.end(), '<'), type.end());
if(type == typeid(double).name())
{
if(size == 2)
{
CreatorProperty<PropType, TypeInt, std::vector<MVector<double,2> > >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(size == 3)
{
CreatorProperty<PropType, TypeInt, std::vector<MVector<double,3> > >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(size == 4)
{
CreatorProperty<PropType, TypeInt, std::vector<MVector<double,4> > >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(size == 6)
{
CreatorProperty<PropType, TypeInt, std::vector<MVector<double,6> > >::CreatePropertyByType(serstorage, mock_unet);
return;
}
}
}
// MDMatrix<T>
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
void UBasePropCreator::CreatePropertyVectorOfMDMatrix(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet)
{
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("Type");
serstorage->SelectUp();
}
// MDMatrix
size_t pos = type.find("MDMatrix");
if (pos != std::string::npos)
{
type.erase(pos, std::string("MDMatrix").length());
}
// '<' '>'
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);
return;
}
if(type == typeid(char).name())
{
CreatorProperty<PropType, TypeInt, MDVector<char> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(unsigned char).name())
{
CreatorProperty<PropType, TypeInt, MDVector<unsigned char> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(short).name())
{
CreatorProperty<PropType, TypeInt, MDVector<short> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(unsigned short).name())
{
CreatorProperty<PropType, TypeInt, MDVector<unsigned short> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(int).name())
{
CreatorProperty<PropType, TypeInt, MDVector<int> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(unsigned int).name())
{
CreatorProperty<PropType, TypeInt, MDVector<unsigned int> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(long).name())
{
CreatorProperty<PropType, TypeInt, MDVector<long> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(unsigned long).name())
{
CreatorProperty<PropType, TypeInt, MDVector<unsigned long> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(long long).name())
{
CreatorProperty<PropType, TypeInt, MDVector<long long> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(unsigned long long).name())
{
CreatorProperty<PropType, TypeInt, MDVector<unsigned long long> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(float).name())
{
CreatorProperty<PropType, TypeInt, MDVector<float> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(double).name())
{
CreatorProperty<PropType, TypeInt, MDVector<double> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(long double).name())
{
CreatorProperty<PropType, TypeInt, MDVector<long double> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
} */
// list
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
void UBasePropCreator::CreatePropertyList(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet)
......@@ -515,293 +296,6 @@ void UBasePropCreator::CreatePropertyList(RDK::USerStorageXML* serstorage, RDK::
return;
}
}
/*
// MDMatrix
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
void UBasePropCreator::CreatePropertyMDMatrix(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet)
{
std::string type = serstorage->GetNodeAttribute("Type");
std::string prop_name = serstorage->GetNodeName();
// MDMatrix
size_t pos = type.find("MDMatrix");
if (pos != std::string::npos)
{
type.erase(pos, std::string("MDMatrix").length());
}
// '<' '>'
type.erase(std::remove(type.begin(), type.end(), '>'), type.end());
type.erase(std::remove(type.begin(), type.end(), '<'), type.end());
std::string matrix_type = type;
if(type == typeid(bool).name())
{
CreatorProperty<PropType, TypeInt, MDMatrix<bool> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(char).name())
{
CreatorProperty<PropType, TypeInt, MDMatrix<char> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(unsigned char).name())
{
CreatorProperty<PropType, TypeInt, MDMatrix<unsigned char> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(short).name())
{
CreatorProperty<PropType, TypeInt, MDMatrix<short> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(unsigned short).name())
{
CreatorProperty<PropType, TypeInt, MDMatrix<unsigned short> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(int).name())
{
CreatorProperty<PropType, TypeInt, MDMatrix<int> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(unsigned int).name())
{
CreatorProperty<PropType, TypeInt, MDMatrix<unsigned int> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(long).name())
{
CreatorProperty<PropType, TypeInt, MDMatrix<long> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(unsigned long).name())
{
CreatorProperty<PropType, TypeInt, MDMatrix<unsigned long> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(long long).name())
{
CreatorProperty<PropType, TypeInt, MDMatrix<long long> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(unsigned long long).name())
{
CreatorProperty<PropType, TypeInt, MDMatrix<unsigned long long> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(float).name())
{
CreatorProperty<PropType, TypeInt, MDMatrix<float> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(double).name())
{
CreatorProperty<PropType, TypeInt, MDMatrix<double> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(long double).name())
{
CreatorProperty<PropType, TypeInt, MDMatrix<long double> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
}
// MDVector
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
void UBasePropCreator::CreatePropertyMDVector(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet)
{
std::string type = serstorage->GetNodeAttribute("Type");
std::string prop_name = serstorage->GetNodeName();
// MDVector
size_t pos = type.find("MDVector");
if (pos != std::string::npos)
{
type.erase(pos, std::string("MDVector").length());
}
// '<' '>'
type.erase(std::remove(type.begin(), type.end(), '>'), type.end());
type.erase(std::remove(type.begin(), type.end(), '<'), type.end());
std::string matrix_type = type;
if(type == typeid(bool).name())
{
CreatorProperty<PropType, TypeInt, MDVector<bool> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(char).name())
{
CreatorProperty<PropType, TypeInt, MDVector<char> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(unsigned char).name())
{
CreatorProperty<PropType, TypeInt, MDVector<unsigned char> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(short).name())
{
CreatorProperty<PropType, TypeInt, MDVector<short> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(unsigned short).name())
{
CreatorProperty<PropType, TypeInt, MDVector<unsigned short> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(int).name())
{
CreatorProperty<PropType, TypeInt, MDVector<int> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(unsigned int).name())
{
CreatorProperty<PropType, TypeInt, MDVector<unsigned int> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(long).name())
{
CreatorProperty<PropType, TypeInt, MDVector<long> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(unsigned long).name())
{
CreatorProperty<PropType, TypeInt, MDVector<unsigned long> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(long long).name())
{
CreatorProperty<PropType, TypeInt, MDVector<long long> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(unsigned long long).name())
{
CreatorProperty<PropType, TypeInt, MDVector<unsigned long long> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(float).name())
{
CreatorProperty<PropType, TypeInt, MDVector<float> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(double).name())
{
CreatorProperty<PropType, TypeInt, MDVector<double> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(long double).name())
{
CreatorProperty<PropType, TypeInt, MDVector<long double> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
}
// MVector size - 2,3,4 - double
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
void UBasePropCreator::CreatePropertyMVector(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet)
{
std::string type = serstorage->GetNodeAttribute("Type");
std::string prop_name = serstorage->GetNodeName();
int size= RDK::atoi(serstorage->GetNodeAttribute("Size"));
// MVector
size_t pos = type.find("MVector");
if (pos != std::string::npos)
{
type.erase(pos, std::string("MVector").length());
}
// '<' '>'
type.erase(std::remove(type.begin(), type.end(), '>'), type.end());
type.erase(std::remove(type.begin(), type.end(), '<'), type.end());
if(type == typeid(double).name())
{
if(size == 2)
{
CreatorProperty<PropType, TypeInt, MVector<double,2> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(size == 3)
{
CreatorProperty<PropType, TypeInt, MVector<double,3> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(size == 4)
{
CreatorProperty<PropType, TypeInt, MVector<double,4> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(size == 6)
{
CreatorProperty<PropType, TypeInt, MVector<double,6> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
}
}
// MMatrix [rows,cols] - [3,3][4,4] - double, int, bool
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
void UBasePropCreator::CreatePropertyMMatrix(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet)
{
std::string type = serstorage->GetNodeAttribute("Type");
std::string prop_name = serstorage->GetNodeName();
int rows= RDK::atoi(serstorage->GetNodeAttribute("Rows"));
int cols= RDK::atoi(serstorage->GetNodeAttribute("Cols"));
// MMatrix
size_t pos = type.find("MMatrix");
if (pos != std::string::npos)
{
type.erase(pos, std::string("MMatrix").length());
}
// '<' '>'
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())
{
if( (rows == 3) && (cols == 3))
{
CreatorProperty<PropType, TypeInt, MMatrix<bool,3,3> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if( (rows == 4) && (cols == 4))
{
CreatorProperty<PropType, TypeInt, MMatrix<bool,4,4> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
}
if(type == typeid(int).name())
{
if( (rows == 3) && (cols == 3))
{
CreatorProperty<PropType, TypeInt, MMatrix<int,3,3> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if( (rows == 4) && (cols == 4))
{
CreatorProperty<PropType, TypeInt, MMatrix<int,4,4> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
}
if(type == typeid(double).name())
{
if( (rows == 3) && (cols == 3))
{
CreatorProperty<PropType, TypeInt, MMatrix<double,3,3> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if( (rows == 4) && (cols == 4))
{
CreatorProperty<PropType, TypeInt, MMatrix<double,4,4> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
}
} */
// std::pair
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
......
......@@ -63,7 +63,7 @@ void UBasePropCreatorMatrix::CreateProperty(RDK::USerStorageXML* serstorage, RDK
CreatePropertyMDVector<PropType, TypeInt>(serstorage,mock_unet);
return;
}
//#ifndef __BORLANDC__ // TODO: ( ?)
// MVector
if(type.find("MVector",0) == 0)
{
......@@ -77,7 +77,6 @@ void UBasePropCreatorMatrix::CreateProperty(RDK::USerStorageXML* serstorage, RDK
CreatePropertyMMatrix<PropType, TypeInt>(serstorage,mock_unet);
return;
}
//#endif
if(type == "std::vector")
{
......@@ -264,7 +263,6 @@ void UBasePropCreatorMatrix::CreatePropertyVectorOfMDMatrix(RDK::USerStorageXML*
}
}
// MDMatrix
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
void UBasePropCreatorMatrix::CreatePropertyMDMatrix(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet)
......
......@@ -41,67 +41,6 @@ const std::vector<std::string>& UBasePropCreatorTempl::GetForbiddenOutputs()
return ForbiddenOutputs;
}
/*
// ( Storage)
bool UBasePropCreatorTempl::BaseCrPropMock(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet)
{
// : Paramenters -> State -> Input -> Output
for(int i =0, params = serstorage->GetNumNodes(); i <params; i++)
{
if(!serstorage->SelectNode(i))
return false;
std::string prop_type = serstorage->GetNodeName();
//
for(int j =0, props = serstorage->GetNumNodes(); j < props; j++)
{
try{
if(!serstorage->SelectNode(j))
return false;
std::string prop_name = serstorage->GetNodeName();
if(prop_type == "Parameters")
{
CreateProperty<ULProperty,ptPubParameter>(serstorage,mock_unet);
}
else if(prop_type == "State")
{
CreateProperty<ULProperty,ptPubState>(serstorage,mock_unet);
}
else if(prop_type == "Input")
{
//
if(std::find(GetForbiddenInputs().begin(),GetForbiddenInputs().end(),serstorage->GetNodeName()) != GetForbiddenInputs().end())
{
serstorage->SelectUp();
continue;
}
CreateProperty<UPropertyInputData,ptPubInput>(serstorage,mock_unet);
}
else if(prop_type == "Output")
{
//
if(std::find(GetForbiddenOutputs().begin(),GetForbiddenOutputs().end(),serstorage->GetNodeName()) != GetForbiddenOutputs().end())
{
serstorage->SelectUp();
continue;
}
CreateProperty<UPropertyOutputData,ptPubOutput>(serstorage,mock_unet);
}
}
catch(UComponent::EPropertyNameAlreadyExist& e)
{
}
catch(...)
{
}
serstorage->SelectUp();
}
serstorage->SelectUp();
}
return true;
} */
}
......@@ -45,11 +45,11 @@ bool BaseCrPropMockTempl(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_u
if(prop_type == "Parameters")
{