Read about our upcoming Code of Conduct on this issue

This instance will be upgraded to Heptapod 0.28.1 on 2022-01-26 at 16:00 UTC+1 (a few minutes of down time)

Commit c4b078c3 authored by Aleksandr Bakhshiev's avatar Aleksandr Bakhshiev
Browse files

C++ builde bugs fixed. Testing required.

--HG--
branch : MockCompsTest
parent 73e15b92c16f
......@@ -233,6 +233,15 @@
<CppCompile Include="..\..\..\Core\Engine\UBasePropCreator.cpp">
<BuildOrder>125</BuildOrder>
</CppCompile>
<CppCompile Include="..\..\..\Core\Engine\UBasePropCreatorMatrix.cpp">
<BuildOrder>130</BuildOrder>
</CppCompile>
<CppCompile Include="..\..\..\Core\Engine\UBasePropCreatorTempl.cpp">
<BuildOrder>129</BuildOrder>
</CppCompile>
<CppCompile Include="..\..\..\Core\Engine\UBasePropCreatorVector.cpp">
<BuildOrder>128</BuildOrder>
</CppCompile>
<CppCompile Include="..\..\..\Core\Engine\UBinaryEnvSerialize.cpp">
<DependentOn>..\..\..\Core\Engine\UBinaryEnvSerialize.h</DependentOn>
<BuildOrder>63</BuildOrder>
......@@ -1015,13 +1024,13 @@
<Operation>1</Operation>
</Platform>
</DeployClass>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
</Deployment>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
......
......@@ -27,6 +27,9 @@ DEFINES += RDK_CORE_VERSION=$$VERSION
SOURCES += \
../../../Core/Engine/UBasePropCreator.cpp \
../../../Core/Engine/UBasePropCreatorMatrix.cpp \
../../../Core/Engine/UBasePropCreatorTempl.cpp \
../../../Core/Engine/UBasePropCreatorVector.cpp \
../../../Deploy/Include/rdk.qt.cpp \
../../../Deploy/Include/myrdk.qt.cpp \
../../../Core/Engine/Engine.cpp \
......@@ -158,6 +161,9 @@ SOURCES += \
HEADERS +=\
../../../Core/Engine/UBasePropCreator.h \
../../../Core/Engine/UBasePropCreatorMatrix.h \
../../../Core/Engine/UBasePropCreatorTempl.h \
../../../Core/Engine/UBasePropCreatorVector.h \
../../../Core/Engine/UCreatorPropTemplate.h \
rdk.qt_global.h \
../../../Deploy/Include/rdk.qt.h \
......
......@@ -4,103 +4,12 @@
namespace RDK {
UBasePropCreator::UBasePropCreator()
{
}
const std::vector<std::string>& UBasePropCreator::GetForbiddenInputs()
{
static std::vector<std::string> ForbiddenInputs;
if(ForbiddenInputs.empty())
{
ForbiddenInputs.push_back("DataInput0");
ForbiddenInputs.push_back("DataInput1");
ForbiddenInputs.push_back("DataInput2");
ForbiddenInputs.push_back("DataInput3");
ForbiddenInputs.push_back("DataInput4");
ForbiddenInputs.push_back("DataInput5");
}
return ForbiddenInputs;
}
const std::vector<std::string>& UBasePropCreator::GetForbiddenOutputs()
{
static std::vector<std::string> ForbiddenOutputs;
if(ForbiddenOutputs.empty())
{
ForbiddenOutputs.push_back("DataOutput0");
ForbiddenOutputs.push_back("DataOutput1");
ForbiddenOutputs.push_back("DataOutput2");
ForbiddenOutputs.push_back("DataOutput3");
ForbiddenOutputs.push_back("DataOutput4");
ForbiddenOutputs.push_back("DataOutput5");
}
return ForbiddenOutputs;
}
// ( Storage)
bool UBasePropCreator::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)
{
return BaseCrPropMockTempl<UBasePropCreator>(serstorage,mock_unet);
}
}
catch(...)
{
}
serstorage->SelectUp();
}
serstorage->SelectUp();
}
return true;
}
}
#ifndef UBASEPROPCREATOR_H
#define UBASEPROPCREATOR_H
#include "UCreatorPropTemplate.h"
#include "UBasePropCreatorTempl.h"
namespace RDK {
//
class UBasePropCreator
class UBasePropCreator: public UBasePropCreatorTempl
{
public:
UBasePropCreator();
static const std::vector<std::string>& GetForbiddenInputs();
static const std::vector<std::string>& GetForbiddenOutputs();
// ( Storage)
static bool BaseCrPropMock(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet);
......@@ -25,14 +20,14 @@ 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);
//
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);
// (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>
......@@ -49,11 +44,11 @@ public:
// 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);
*/
// 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);
......@@ -69,7 +64,7 @@ public:
// 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);
......@@ -97,20 +92,7 @@ void UBasePropCreator::CreateProperty(RDK::USerStorageXML* serstorage, RDK::UMoc
{
CreatorProperty<PropType, TypeInt, std::string>::CreatePropertyByType(serstorage,mock_unet);
return;
}
// ( CreatePropertyByType) -
if(type == "std::vector")
{
CreatePropertyVector<PropType, TypeInt>(serstorage,mock_unet);
return;
}
// (bool, int, double)
if(type == "simplevector")
{
CreatePropertySimpleVector<PropType, TypeInt>(serstorage,mock_unet);
return;
}
}
// list
if(type == "std::list")
......@@ -168,7 +150,7 @@ void UBasePropCreator::CreateProperty(RDK::USerStorageXML* serstorage, RDK::UMoc
return;
}
/*
/*
// pointer //
if(type == "pointer")
{
......@@ -176,7 +158,7 @@ void UBasePropCreator::CreateProperty(RDK::USerStorageXML* serstorage, RDK::UMoc
return;
}
*/
/*
// MDMatrix
if(type.find("MDMatrix",0) == 0)
{
......@@ -204,7 +186,7 @@ void UBasePropCreator::CreateProperty(RDK::USerStorageXML* serstorage, RDK::UMoc
CreatePropertyMMatrix<PropType, TypeInt>(serstorage,mock_unet);
return;
}
//#endif
//#endif */
}
// ,
......@@ -290,255 +272,23 @@ bool UBasePropCreator::CreateSimpleTypeProperty(RDK::USerStorageXML* serstorage,
}
//
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
void UBasePropCreator::CreatePropertyVector(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();
}
if(type == typeid(bool).name())
{
CreatorProperty<PropType, TypeInt, std::vector<bool> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(char).name())
{
CreatorProperty<PropType, TypeInt, std::vector<char> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(unsigned char).name())
{
CreatorProperty<PropType, TypeInt, std::vector<unsigned char> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(short).name())
{
CreatorProperty<PropType, TypeInt, std::vector<short> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(unsigned short).name())
{
CreatorProperty<PropType, TypeInt, std::vector<unsigned short> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(int).name())
{
CreatorProperty<PropType, TypeInt, std::vector<int> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(unsigned int).name())
{
CreatorProperty<PropType, TypeInt, std::vector<unsigned int> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(long).name())
{
CreatorProperty<PropType, TypeInt, std::vector<long> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(unsigned long).name())
{
CreatorProperty<PropType, TypeInt, std::vector<unsigned long> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(long long).name())
{
CreatorProperty<PropType, TypeInt, std::vector<long long> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(unsigned long long).name())
{
CreatorProperty<PropType, TypeInt, std::vector<unsigned long long> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(float).name())
{
CreatorProperty<PropType, TypeInt, std::vector<float> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(double).name())
{
CreatorProperty<PropType, TypeInt, std::vector<double> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(long double).name())
{
CreatorProperty<PropType, TypeInt, std::vector<long double> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == "UColorT")
{
CreatorProperty<PropType, TypeInt, std::vector<UColorT> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == "std::string")
{
CreatorProperty<PropType, TypeInt, std::vector<std::string> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == "UBitmapParam")
{
CreatorProperty<PropType, TypeInt, std::vector<UBitmapParam> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == "UBitmap")
{
CreatorProperty<PropType, TypeInt, std::vector<UBitmap> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
// RTV
// if(type == "UBVSObject")
// {
// CreatorProperty<PropType, TypeInt, std::vector<RTV::UBVSObject3D> >::CreatePropertyByType(serstorage, mock_unet);
// return;
// }
//
if(type == "std::pair")
{
CreatePropertyVectorOfPair<PropType, TypeInt>(serstorage, mock_unet);
return;
}
//
if(type == "simplevector")
{
CreatePropertyVectorOfSimVec<PropType, TypeInt>(serstorage, mock_unet);
return;
}
// MVector<T>
if(type.find("MVector",0) == 0)
{
CreatePropertyVectorOfMVector<PropType, TypeInt>(serstorage, mock_unet);
return;
}
// MDMatrix<T>
if(type.find("MDMatrix",0) == 0)
{
CreatePropertyVectorOfMDMatrix<PropType, TypeInt>(serstorage, mock_unet);
return;
}
}
// (simpleVector)
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
void UBasePropCreator::CreatePropertySimpleVector(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet)
{
std::string prop_name = serstorage->GetNodeName();
std::string type = serstorage->GetNodeAttribute("elemType");
if(type == typeid(bool).name())
{
CreatorProperty<PropType, TypeInt, std::vector<char> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(int).name())
{
CreatorProperty<PropType, TypeInt, std::vector<int> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(double).name())
{
CreatorProperty<PropType, TypeInt, std::vector<double> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
}
// std::vector<simpleVector> >
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
void UBasePropCreator::CreatePropertyVectorOfSimVec(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet)
{
std::string prop_name = serstorage->GetNodeName();
int size=serstorage->GetNumNodes();
if(!(serstorage->SelectNode("elem",size-1)))
return;
std::string type = serstorage->GetNodeAttribute("elemType");
serstorage->SelectUp();
if(type == typeid(bool).name())
{
CreatorProperty<PropType, TypeInt, std::vector<std::vector<char> > >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(int).name())
{
CreatorProperty<PropType, TypeInt, std::vector<std::vector<int> > >::CreatePropertyByType(serstorage, mock_unet);
return;
}
if(type == typeid(double).name())
{
CreatorProperty<PropType, TypeInt, std::vector<std::vector<double> > >::CreatePropertyByType(serstorage, mock_unet);
return;
}
}
//
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
void UBasePropCreator::CreatePropertyVectorOfPair(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet)
{
std::string prop_name = serstorage->GetNodeName();
int size=serstorage->GetNumNodes();
if(!(serstorage->SelectNode("elem",size-1)))
return;
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();
serstorage->SelectUp();
if(first_type == "std::string")
{
if(second_type == typeid(bool).name())
{
CreatorProperty<PropType, TypeInt, std::pair<std::string,bool> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
}
}
/*
// 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();
std::string prop_name = serstorage->GetNodeName();
if(!(serstorage->SelectNode("elem")))
return;
if(!(serstorage->SelectNode("elem")))
return;
std::string type = serstorage->GetNodeAttribute("Type");
int size= RDK::atoi(serstorage->GetNodeAttribute("Size"));
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)
{
// MVector
size_t pos = type.find("MVector");
if (pos != std::string::npos)
{
type.erase(pos, std::string("MVector").length());
}
// '<' '>'
......@@ -671,7 +421,7 @@ void UBasePropCreator::CreatePropertyVectorOfMDMatrix(RDK::USerStorageXML* serst
CreatorProperty<PropType, TypeInt, MDVector<long double> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
}
} */
// list
template <template<typename, typename, unsigned int> class PropType, unsigned int TypeInt>
......@@ -765,7 +515,7 @@ 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)
......@@ -1050,8 +800,8 @@ void UBasePropCreator::CreatePropertyMMatrix(RDK::USerStorageXML* serstorage, RD
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>
......@@ -1184,7 +934,7 @@ void UBasePropCreator::CreatePropertyMap(RDK::USerStorageXML* serstorage, RDK::U
CreatorProperty<PropType, TypeInt, std::map<int,UColorT> >::CreatePropertyByType(serstorage, mock_unet);
return;
}
}
}
}
......
#include "UBasePropCreatorMatrix.h"
#include "UComponent.h"
namespace RDK {
// ( Storage)
bool UBasePropCreatorMatrix::BaseCrPropMock(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet)
{
return BaseCrPropMockTempl<UBasePropCreatorMatrix>(serstorage,mock_unet);
}
}
#ifndef UBASEPROPCREATORMATRIX_H
#define UBASEPROPCREATORMATRIX_H
#include "UBasePropCreatorTempl.h"
namespace RDK {
//
class UBasePropCreatorMatrix: public UBasePropCreatorTempl
{
public:
// ( Storage)
static bool BaseCrPropMock(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_unet);