interface ChildIterator;
interface Driver;
interface AttributeStudyProperties;
+ interface AttributeParameter;
interface UseCaseIterator;
interface UseCaseBuilder;
boolean DumpStudy(in string thePath, in string theBaseName, in boolean isPublished);
+/*!
+ Returns an AttributeParameter used to store common parameters for given %theSavePoint.
+ \param theID identifies a common parameters set (Example: "Interface Applicative")
+ \param theSavePoint is number of a set of parameters as there can be several sets
+*/
+ AttributeParameter GetCommonParameters(in string theID, in long theSavePoint);
+
+/*!
+ Returns an AttributeParameter used to store parameters for given %theModuleName.
+ \param theID identifies a common parameters set (Example: "Interface Applicative")
+ \param theModuleName is a name of the module (Example: "Geometry")
+ \param theSavePoint is number of a set of parameters as there can be several sets
+*/
+ AttributeParameter GetModuleParameters(in string theID, in string theModuleName, in long theSavePoint);
+
/*!
Private method, returns an implementation of this Study.
\param theHostname is a hostname of the caller
\param theID An ID of a parameter.
\param theValue A value of the parameter
*/
- void SetInt(in long theID, in long theValue);
+ void SetInt(in string theID, in long theValue);
/*!
Returns a int value associated with the given ID
\param theID An ID of a parameter.
*/
- long GetInt(in long theID);
+ long GetInt(in string theID);
/*!
Associates a real value with the ID
\param theID An ID of a parameter.
\param theValue A value of the parameter
*/
- void SetReal(in long theID, in double theValue);
+ void SetReal(in string theID, in double theValue);
/*!
Returns a real value associated with the given ID
\param theID An ID of a parameter.
*/
- double GetReal(in long theID);
+ double GetReal(in string theID);
/*!
Associates a string value with the ID
\param theID An ID of a parameter.
\param theValue A value of the parameter
*/
- void SetString(in long theID, in string theValue);
+ void SetString(in string theID, in string theValue);
/*!
Returns a string value associated with the given ID
\param theID An ID of a parameter.
*/
- string GetString(in long theID);
+ string GetString(in string theID);
/*!
Associates a boolean value with the ID
\param theID An ID of a parameter.
\param theValue A value of the parameter
*/
- void SetBool(in long theID, in boolean theValue);
+ void SetBool(in string theID, in boolean theValue);
/*!
Returns a boolean value associated with the given ID
\param theID An ID of a parameter.
*/
- boolean GetBool(in long theID);
+ boolean GetBool(in string theID);
/*!
Associates an array of real values with the ID
\param theID An ID of a parameter.
\param theArray The array of real values
*/
- void SetRealArray(in long theID, in DoubleSeq theArray);
+ void SetRealArray(in string theID, in DoubleSeq theArray);
/*!
Returns an array of real values associated with the ID
\param theID An ID of a parameter.
*/
- DoubleSeq GetRealArray(in long theID);
+ DoubleSeq GetRealArray(in string theID);
/*!
Associates an array of integer values with the ID
\param theID An ID of a parameter.
\param theArray The array of integer values
*/
- void SetIntArray(in long theID, in LongSeq theArray);
+ void SetIntArray(in string theID, in LongSeq theArray);
/*!
Returns an array of integer values associated with the ID
\param theID An ID of a parameter.
*/
- LongSeq GetIntArray(in long theID);
+ LongSeq GetIntArray(in string theID);
/*!
Associates an array of string values with the ID
\param theID An ID of a parameter.
\param theArray The array of string values
*/
- void SetStrArray(in long theID, in StringSeq theArray);
+ void SetStrArray(in string theID, in StringSeq theArray);
/*!
Returns an array of string values associated with the ID
\param theID An ID of a parameter.
*/
- StringSeq GetStrArray(in long theID);
+ StringSeq GetStrArray(in string theID);
/*!
Returns True if for the ID of given type was assigned a value in the attribute
\param theID An ID of a parameter.
- \param theType A type of parameter [0(Int), 1(Real), 2(Boolean), 3(String), 4(Triplet)].
+ \param theType A type of parameter [0(Int), 1(Real), 2(Boolean), 3(String), 4(RealArray), 5(IntArray), 6(StrArray)].
*/
- boolean IsSet(in long theID, in long theType);
+ boolean IsSet(in string theID, in long theType);
/*!
Removes a parameter with given ID and Type, returns True if succeded
\param theID An ID of a parameter.
- \param theType A type of parameter [0(Int), 1(Real), 2(Boolean), 3(String), 4(Triplet)].
+ \param theType A type of parameter [0(Int), 1(Real), 2(Boolean), 3(String), 4(RealArray), 5(IntArray), 6(StrArray)].
*/
- boolean RemoveID(in long theID, in long theType);
+ boolean RemoveID(in string theID, in long theType);
/*!
Returns a father attribute of this attribute
*/
void Clear();
/*!
Returns a sequence of ID's of the give type
- \param theType A type of parameter [0(Int), 1(Real), 2(Boolean), 3(String), 4(Triplet)].
+ \param theType A type of parameter [0(Int), 1(Real), 2(Boolean), 3(String), 4(RealArray), 5(IntArray), 6(StrArray)].
*/
- LongSeq GetIDs(in long theType);
+ StringSeq GetIDs(in long theType);
};
};
#endif
* Purpose : Associates a integer value with the ID
*/
//=======================================================================
-void SALOMEDS_AttributeParameter::SetInt(const int theID, const int& theValue)
+void SALOMEDS_AttributeParameter::SetInt(const string& theID, const int theValue)
{
CheckLocked();
if(_isLocal)
Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->SetInt(theID, theValue);
else
- SALOMEDS::AttributeParameter::_narrow(_corba_impl)->SetInt(theID, theValue);
+ SALOMEDS::AttributeParameter::_narrow(_corba_impl)->SetInt(theID.c_str(), theValue);
}
//=======================================================================
* Purpose : Returns a int value associated with the given ID
*/
//=======================================================================
-int SALOMEDS_AttributeParameter::GetInt(const int theID)
+int SALOMEDS_AttributeParameter::GetInt(const string& theID)
{
int aValue;
if(_isLocal)
aValue = Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->GetInt(theID);
else
- aValue = SALOMEDS::AttributeParameter::_narrow(_corba_impl)->GetInt(theID);
+ aValue = SALOMEDS::AttributeParameter::_narrow(_corba_impl)->GetInt(theID.c_str());
return aValue;
}
* Purpose : Associates a double value with the ID
*/
//=======================================================================
-void SALOMEDS_AttributeParameter::SetReal(const int theID, const double& theValue)
+void SALOMEDS_AttributeParameter::SetReal(const string& theID, const double& theValue)
{
CheckLocked();
if(_isLocal)
Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->SetReal(theID, theValue);
else
- SALOMEDS::AttributeParameter::_narrow(_corba_impl)->SetReal(theID, theValue);
+ SALOMEDS::AttributeParameter::_narrow(_corba_impl)->SetReal(theID.c_str(), theValue);
}
//=======================================================================
* Purpose : Returns a double value associated with the given ID
*/
//=======================================================================
-double SALOMEDS_AttributeParameter::GetReal(const int theID)
+double SALOMEDS_AttributeParameter::GetReal(const string& theID)
{
double aValue;
if(_isLocal)
aValue = Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->GetReal(theID);
else
- aValue = SALOMEDS::AttributeParameter::_narrow(_corba_impl)->GetReal(theID);
+ aValue = SALOMEDS::AttributeParameter::_narrow(_corba_impl)->GetReal(theID.c_str());
return aValue;
}
* Purpose : Associates a string with the ID
*/
//=======================================================================
-void SALOMEDS_AttributeParameter::SetString(const int theID, const string& theValue)
+void SALOMEDS_AttributeParameter::SetString(const string& theID, const string& theValue)
{
CheckLocked();
if(_isLocal)
- Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->SetString(theID, (char*)theValue.c_str());
+ Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->SetString(theID, theValue);
else
- SALOMEDS::AttributeParameter::_narrow(_corba_impl)->SetString(theID, theValue.c_str());
+ SALOMEDS::AttributeParameter::_narrow(_corba_impl)->SetString(theID.c_str(), theValue.c_str());
}
//=======================================================================
* Purpose : Returns a string associated with the given ID
*/
//=======================================================================
-string SALOMEDS_AttributeParameter::GetString(const int theID)
+string SALOMEDS_AttributeParameter::GetString(const string& theID)
{
string aValue;
if(_isLocal)
- aValue = Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->GetString(theID).ToCString();
+ aValue = Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->GetString(theID);
else
- aValue = SALOMEDS::AttributeParameter::_narrow(_corba_impl)->GetString(theID);
+ aValue = SALOMEDS::AttributeParameter::_narrow(_corba_impl)->GetString(theID.c_str());
return aValue;
}
* Purpose : Associates a bool value with the ID
*/
//=======================================================================
-void SALOMEDS_AttributeParameter::SetBool(const int theID, const bool& theValue)
+void SALOMEDS_AttributeParameter::SetBool(const string& theID, const bool& theValue)
{
CheckLocked();
if(_isLocal)
Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->SetBool(theID, theValue);
else
- SALOMEDS::AttributeParameter::_narrow(_corba_impl)->SetBool(theID, theValue);
+ SALOMEDS::AttributeParameter::_narrow(_corba_impl)->SetBool(theID.c_str(), theValue);
}
//=======================================================================
* Purpose : Returns a bool value associated with the ID
*/
//=======================================================================
-bool SALOMEDS_AttributeParameter::GetBool(const int theID)
+bool SALOMEDS_AttributeParameter::GetBool(const string& theID)
{
if(_isLocal)
return Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->GetBool(theID);
else
- return SALOMEDS::AttributeParameter::_narrow(_corba_impl)->GetBool(theID);
+ return SALOMEDS::AttributeParameter::_narrow(_corba_impl)->GetBool(theID.c_str());
}
//=======================================================================
* Purpose : Associates an array of double values with the given ID
*/
//=======================================================================
-void SALOMEDS_AttributeParameter::SetRealArray(const int theID, const vector<double>& theArray)
+void SALOMEDS_AttributeParameter::SetRealArray(const string& theID, const vector<double>& theArray)
{
CheckLocked();
aSeq->length(length);
for(int i = 0; i<length; i++) aSeq[i] = theArray[i];
}
- SALOMEDS::AttributeParameter::_narrow(_corba_impl)->SetRealArray(theID, aSeq);
+ SALOMEDS::AttributeParameter::_narrow(_corba_impl)->SetRealArray(theID.c_str(), aSeq);
}
}
* Purpose : Returns an array of double values associated with the ID
*/
//=======================================================================
-vector<double> SALOMEDS_AttributeParameter::GetRealArray(const int theID)
+vector<double> SALOMEDS_AttributeParameter::GetRealArray(const string& theID)
{
vector<double> v;
if(_isLocal)
return Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->GetRealArray(theID);
else {
- SALOMEDS::DoubleSeq_var aSeq = SALOMEDS::AttributeParameter::_narrow(_corba_impl)->GetRealArray(theID);
+ SALOMEDS::DoubleSeq_var aSeq = SALOMEDS::AttributeParameter::_narrow(_corba_impl)->GetRealArray(theID.c_str());
int length = aSeq->length();
if(length) {
v.resize(length);
* Purpose : Associates an array of int values with the given ID
*/
//=======================================================================
-void SALOMEDS_AttributeParameter::SetIntArray(const int theID, const vector<int>& theArray)
+void SALOMEDS_AttributeParameter::SetIntArray(const string& theID, const vector<int>& theArray)
{
CheckLocked();
aSeq->length(length);
for(int i = 0; i<length; i++) aSeq[i] = theArray[i];
}
- SALOMEDS::AttributeParameter::_narrow(_corba_impl)->SetIntArray(theID, aSeq);
+ SALOMEDS::AttributeParameter::_narrow(_corba_impl)->SetIntArray(theID.c_str(), aSeq);
}
}
* Purpose : Returns an array of int values associated with the ID
*/
//=======================================================================
-vector<int> SALOMEDS_AttributeParameter::GetIntArray(const int theID)
+vector<int> SALOMEDS_AttributeParameter::GetIntArray(const string& theID)
{
vector<int> v;
if(_isLocal)
return Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->GetIntArray(theID);
else {
- SALOMEDS::LongSeq_var aSeq = SALOMEDS::AttributeParameter::_narrow(_corba_impl)->GetIntArray(theID);
+ SALOMEDS::LongSeq_var aSeq = SALOMEDS::AttributeParameter::_narrow(_corba_impl)->GetIntArray(theID.c_str());
int length = aSeq->length();
if(length) {
v.resize(length);
* Purpose : Associates an array of string values with the given ID
*/
//=======================================================================
-void SALOMEDS_AttributeParameter::SetStrArray(const int theID, const vector<string>& theArray)
+void SALOMEDS_AttributeParameter::SetStrArray(const string& theID, const vector<string>& theArray)
{
CheckLocked();
aSeq->length(length);
for(int i = 0; i<length; i++) aSeq[i] = CORBA::string_dup(theArray[i].c_str());
}
- SALOMEDS::AttributeParameter::_narrow(_corba_impl)->SetStrArray(theID, aSeq);
+ SALOMEDS::AttributeParameter::_narrow(_corba_impl)->SetStrArray(theID.c_str(), aSeq);
}
}
* Purpose : Returns an array of string values associated with the ID
*/
//=======================================================================
-vector<string> SALOMEDS_AttributeParameter::GetStrArray(const int theID)
+vector<string> SALOMEDS_AttributeParameter::GetStrArray(const string& theID)
{
vector<string> v;
if(_isLocal)
return Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->GetStrArray(theID);
else {
- SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeParameter::_narrow(_corba_impl)->GetStrArray(theID);
+ SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeParameter::_narrow(_corba_impl)->GetStrArray(theID.c_str());
int length = aSeq->length();
if(length) {
v.resize(length);
* a value in the attribute
*/
//=======================================================================
-bool SALOMEDS_AttributeParameter::IsSet(const int theID, const int theType)
+bool SALOMEDS_AttributeParameter::IsSet(const string& theID, const int theType)
{
if(_isLocal)
return Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->IsSet(theID, (Parameter_Types)theType);
else
- return SALOMEDS::AttributeParameter::_narrow(_corba_impl)->IsSet(theID, theType);
+ return SALOMEDS::AttributeParameter::_narrow(_corba_impl)->IsSet(theID.c_str(), theType);
}
//=======================================================================
* Purpose : Removes a parameter with given ID
*/
//=======================================================================
-bool SALOMEDS_AttributeParameter::RemoveID(const int theID, const int theType)
+bool SALOMEDS_AttributeParameter::RemoveID(const string& theID, const int theType)
{
CheckLocked();
if(_isLocal)
return Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->RemoveID(theID, (Parameter_Types)theType);
else
- return SALOMEDS::AttributeParameter::_narrow(_corba_impl)->RemoveID(theID, theType);
+ return SALOMEDS::AttributeParameter::_narrow(_corba_impl)->RemoveID(theID.c_str(), theType);
}
//=======================================================================
* Purpose : Returns an array of all ID's of the given type
*/
//=======================================================================
-vector<int> SALOMEDS_AttributeParameter::GetIDs(const int theType)
+vector<string> SALOMEDS_AttributeParameter::GetIDs(const int theType)
{
- vector<int> v;
+ vector<string> v;
if(_isLocal) {
Handle(SALOMEDSImpl_AttributeParameter) AP_impl = Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl);
return AP_impl->GetIDs((Parameter_Types)theType);
}
else {
SALOMEDS::AttributeParameter_var AP_impl = SALOMEDS::AttributeParameter::_narrow(_corba_impl);
- SALOMEDS::LongSeq_var CorbaSeq = AP_impl->GetIDs(theType);
+ SALOMEDS::StringSeq_var CorbaSeq = AP_impl->GetIDs(theType);
int length = CorbaSeq->length();
if(length) {
v.resize(length);
- for(int i = 0; i <length; i++) v[i] = CorbaSeq[i];
+ for(int i = 0; i <length; i++) v[i] = string(CorbaSeq[i].in());
}
}
SALOMEDS_AttributeParameter(SALOMEDS::AttributeParameter_ptr theAttr);
~SALOMEDS_AttributeParameter();
- virtual void SetInt(const int theID, const int& theValue);
- virtual int GetInt(const int theID);
+ virtual void SetInt(const std::string& theID, const int theValue);
+ virtual int GetInt(const std::string& theID);
- virtual void SetReal(const int theID, const double& theValue);
- virtual double GetReal(const int theID);
+ virtual void SetReal(const std::string& theID, const double& theValue);
+ virtual double GetReal(const std::string& theID);
- virtual void SetString(const int theID, const std::string& theValue);
- virtual std::string GetString(const int theID);
+ virtual void SetString(const std::string& theID, const std::string& theValue);
+ virtual std::string GetString(const std::string& theID);
- virtual void SetBool(const int theID, const bool& theValue);
- virtual bool GetBool(const int theID);
+ virtual void SetBool(const std::string& theID, const bool& theValue);
+ virtual bool GetBool(const std::string& theID);
- virtual void SetRealArray(const int theID, const std::vector<double>& theArray);
- virtual std::vector<double> GetRealArray(const int theID);
+ virtual void SetRealArray(const std::string& theID, const std::vector<double>& theArray);
+ virtual std::vector<double> GetRealArray(const std::string& theID);
- virtual void SetIntArray(const int theID, const std::vector<int>& theArray);
- virtual std::vector<int> GetIntArray(const int theID);
+ virtual void SetIntArray(const std::string& theID, const std::vector<int>& theArray);
+ virtual std::vector<int> GetIntArray(const std::string& theID);
- virtual void SetStrArray(const int theID, const std::vector<std::string>& theArray);
- virtual std::vector<std::string> GetStrArray(const int theID);
+ virtual void SetStrArray(const std::string& theID, const std::vector<std::string>& theArray);
+ virtual std::vector<std::string> GetStrArray(const std::string& theID);
- virtual bool IsSet(const int theID, const int theType);
+ virtual bool IsSet(const std::string& theID, const int theType);
- virtual bool RemoveID(const int theID, const int theType);
+ virtual bool RemoveID(const std::string& theID, const int theType);
virtual _PTR(AttributeParameter) GetFather();
virtual bool HasFather();
virtual void Clear();
- virtual std::vector<int> GetIDs(const int theType);
+ virtual std::vector<std::string> GetIDs(const int theType);
};
#endif
* Purpose : Associates a integer value with the ID
*/
//=======================================================================
-void SALOMEDS_AttributeParameter_i::SetInt(CORBA::Long theID, CORBA::Long theValue)
+void SALOMEDS_AttributeParameter_i::SetInt(const char* theID, CORBA::Long theValue)
{
SALOMEDS::Locker lock;
CheckLocked();
* Purpose : Returns a int value associated with the given ID
*/
//=======================================================================
-CORBA::Long SALOMEDS_AttributeParameter_i::GetInt(CORBA::Long theID)
+CORBA::Long SALOMEDS_AttributeParameter_i::GetInt(const char* theID)
{
SALOMEDS::Locker lock;
return Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_impl)->GetInt(theID);
* Purpose : Associates a double value with the ID
*/
//=======================================================================
-void SALOMEDS_AttributeParameter_i::SetReal(CORBA::Long theID, const CORBA::Double theValue)
+void SALOMEDS_AttributeParameter_i::SetReal(const char* theID, const CORBA::Double theValue)
{
SALOMEDS::Locker lock;
CheckLocked();
* Purpose : Returns a double value associated with the given ID
*/
//=======================================================================
-CORBA::Double SALOMEDS_AttributeParameter_i::GetReal(CORBA::Long theID)
+CORBA::Double SALOMEDS_AttributeParameter_i::GetReal(const char* theID)
{
SALOMEDS::Locker lock;
return Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_impl)->GetReal(theID);
* Purpose : Associates a string with the ID
*/
//=======================================================================
-void SALOMEDS_AttributeParameter_i::SetString(CORBA::Long theID, const char* theValue)
+void SALOMEDS_AttributeParameter_i::SetString(const char* theID, const char* theValue)
{
SALOMEDS::Locker lock;
CheckLocked();
Handle(SALOMEDSImpl_AttributeParameter) impl = Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_impl);
- impl->SetString(theID, TCollection_AsciiString((char*)theValue));
+ impl->SetString(theID, theValue);
}
//=======================================================================
* Purpose : Returns a string associated with the given ID
*/
//=======================================================================
-char* SALOMEDS_AttributeParameter_i::GetString(CORBA::Long theID)
+char* SALOMEDS_AttributeParameter_i::GetString(const char* theID)
{
SALOMEDS::Locker lock;
Handle(SALOMEDSImpl_AttributeParameter) impl = Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_impl);
- CORBA::String_var c_s = CORBA::string_dup(TCollection_AsciiString(impl->GetString(theID)).ToCString());
+ CORBA::String_var c_s = CORBA::string_dup(impl->GetString(theID).c_str());
return c_s._retn();
}
* Purpose : Associates a bool value with the ID
*/
//=======================================================================
-void SALOMEDS_AttributeParameter_i::SetBool(CORBA::Long theID, CORBA::Boolean theValue)
+void SALOMEDS_AttributeParameter_i::SetBool(const char* theID, CORBA::Boolean theValue)
{
SALOMEDS::Locker lock;
CheckLocked();
* Purpose : Returns a bool value associated with the ID
*/
//=======================================================================
-CORBA::Boolean SALOMEDS_AttributeParameter_i::GetBool(CORBA::Long theID)
+CORBA::Boolean SALOMEDS_AttributeParameter_i::GetBool(const char* theID)
{
SALOMEDS::Locker lock;
return Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_impl)->GetBool(theID);
* Purpose : Associates an array of double values with the given ID
*/
//=======================================================================
-void SALOMEDS_AttributeParameter_i::SetRealArray(CORBA::Long theID, const SALOMEDS::DoubleSeq& theArray)
+void SALOMEDS_AttributeParameter_i::SetRealArray(const char* theID, const SALOMEDS::DoubleSeq& theArray)
{
SALOMEDS::Locker lock;
CheckLocked();
* Purpose : Returns an array of double values associated with the ID
*/
//=======================================================================
-SALOMEDS::DoubleSeq* SALOMEDS_AttributeParameter_i::GetRealArray(CORBA::Long theID)
+SALOMEDS::DoubleSeq* SALOMEDS_AttributeParameter_i::GetRealArray(const char* theID)
{
SALOMEDS::Locker lock;
SALOMEDS::DoubleSeq_var aSeq = new SALOMEDS::DoubleSeq;
* Purpose : Associates an array of int values with the given ID
*/
//=======================================================================
-void SALOMEDS_AttributeParameter_i::SetIntArray(CORBA::Long theID, const SALOMEDS::LongSeq& theArray)
+void SALOMEDS_AttributeParameter_i::SetIntArray(const char* theID, const SALOMEDS::LongSeq& theArray)
{
SALOMEDS::Locker lock;
CheckLocked();
* Purpose : Returns an array of int values associated with the ID
*/
//=======================================================================
-SALOMEDS::LongSeq* SALOMEDS_AttributeParameter_i::GetIntArray(CORBA::Long theID)
+SALOMEDS::LongSeq* SALOMEDS_AttributeParameter_i::GetIntArray(const char* theID)
{
SALOMEDS::Locker lock;
SALOMEDS::LongSeq_var aSeq = new SALOMEDS::LongSeq;
* Purpose : Associates an array of string values with the given ID
*/
//=======================================================================
-void SALOMEDS_AttributeParameter_i::SetStrArray(CORBA::Long theID, const SALOMEDS::StringSeq& theArray)
+void SALOMEDS_AttributeParameter_i::SetStrArray(const char* theID, const SALOMEDS::StringSeq& theArray)
{
SALOMEDS::Locker lock;
CheckLocked();
* Purpose : Returns an array of string values associated with the ID
*/
//=======================================================================
-SALOMEDS::StringSeq* SALOMEDS_AttributeParameter_i::GetStrArray(CORBA::Long theID)
+SALOMEDS::StringSeq* SALOMEDS_AttributeParameter_i::GetStrArray(const char* theID)
{
SALOMEDS::Locker lock;
SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq;
* a value in the attribute
*/
//=======================================================================
-CORBA::Boolean SALOMEDS_AttributeParameter_i::IsSet(CORBA::Long theID, CORBA::Long theType)
+CORBA::Boolean SALOMEDS_AttributeParameter_i::IsSet(const char* theID, CORBA::Long theType)
{
SALOMEDS::Locker lock;
return Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_impl)->IsSet(theID, (Parameter_Types)theType);
* Purpose : Removes a parameter with given ID
*/
//=======================================================================
-CORBA::Boolean SALOMEDS_AttributeParameter_i::RemoveID(CORBA::Long theID, CORBA::Long theType)
+CORBA::Boolean SALOMEDS_AttributeParameter_i::RemoveID(const char* theID, CORBA::Long theType)
{
SALOMEDS::Locker lock;
CheckLocked();
* Purpose : Returns an array of all ID's of the given type
*/
//=======================================================================
-SALOMEDS::LongSeq* SALOMEDS_AttributeParameter_i::GetIDs(CORBA::Long theType)
+SALOMEDS::StringSeq* SALOMEDS_AttributeParameter_i::GetIDs(CORBA::Long theType)
{
SALOMEDS::Locker lock;
- SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
- vector<int> A = Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_impl)->GetIDs((Parameter_Types)theType);
+ SALOMEDS::StringSeq_var CorbaSeq = new SALOMEDS::StringSeq;
+ vector<string> A = Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_impl)->GetIDs((Parameter_Types)theType);
if(A.size()) {
int length = A.size();
CorbaSeq->length(length);
- for (int i = 0; i < length; i++) CorbaSeq[i] = A[i];;
+ for (int i = 0; i < length; i++) CorbaSeq[i] = CORBA::string_dup(A[i].c_str());;
}
return CorbaSeq._retn();
~SALOMEDS_AttributeParameter_i() {};
- virtual void SetInt(CORBA::Long theID, CORBA::Long theValue);
- virtual CORBA::Long GetInt(CORBA::Long theID);
+ virtual void SetInt(const char* theID, CORBA::Long theValue);
+ virtual CORBA::Long GetInt(const char* theID);
- virtual void SetReal(CORBA::Long theID, const CORBA::Double theValue);
- virtual CORBA::Double GetReal(CORBA::Long theID);
+ virtual void SetReal(const char* theID, const CORBA::Double theValue);
+ virtual CORBA::Double GetReal(const char* theID);
- virtual void SetString(CORBA::Long theID, const char* theValue);
- virtual char* GetString(CORBA::Long theID);
+ virtual void SetString(const char* theID, const char* theValue);
+ virtual char* GetString(const char* theID);
- virtual void SetBool(CORBA::Long theID, CORBA::Boolean theValue);
- virtual CORBA::Boolean GetBool(CORBA::Long theID);
+ virtual void SetBool(const char* theID, CORBA::Boolean theValue);
+ virtual CORBA::Boolean GetBool(const char* theID);
- virtual void SetRealArray(CORBA::Long theID, const SALOMEDS::DoubleSeq& theArray);
- virtual SALOMEDS::DoubleSeq* GetRealArray(CORBA::Long theID);
+ virtual void SetRealArray(const char* theID, const SALOMEDS::DoubleSeq& theArray);
+ virtual SALOMEDS::DoubleSeq* GetRealArray(const char* theID);
- virtual void SetIntArray(CORBA::Long theID, const SALOMEDS::LongSeq& theArray);
- virtual SALOMEDS::LongSeq* GetIntArray(CORBA::Long theID);
+ virtual void SetIntArray(const char* theID, const SALOMEDS::LongSeq& theArray);
+ virtual SALOMEDS::LongSeq* GetIntArray(const char* theID);
- virtual void SetStrArray(CORBA::Long theID, const SALOMEDS::StringSeq& theArray);
- virtual SALOMEDS::StringSeq* GetStrArray(CORBA::Long theID);
+ virtual void SetStrArray(const char* theID, const SALOMEDS::StringSeq& theArray);
+ virtual SALOMEDS::StringSeq* GetStrArray(const char* theID);
- virtual CORBA::Boolean IsSet(CORBA::Long theID, CORBA::Long theType);
+ virtual CORBA::Boolean IsSet(const char* theID, CORBA::Long theType);
- virtual CORBA::Boolean RemoveID(CORBA::Long theID, CORBA::Long theType);
+ virtual CORBA::Boolean RemoveID(const char* theID, CORBA::Long theType);
virtual SALOMEDS::AttributeParameter_ptr GetFather();
virtual CORBA::Boolean HasFather();
virtual void Clear();
- virtual SALOMEDS::LongSeq* GetIDs(CORBA::Long theType);
+ virtual SALOMEDS::StringSeq* GetIDs(CORBA::Long theType);
};
#include "SALOMEDSImpl_AttributeStudyProperties.hxx"
#include "SALOMEDS_UseCaseBuilder.hxx"
#include "SALOMEDSImpl_UseCaseBuilder.hxx"
+#include "SALOMEDS_AttributeParameter.hxx"
+#include "SALOMEDSImpl_AttributeParameter.hxx"
#include "SALOMEDS_Driver_i.hxx"
#include "SALOMEDS_Study_i.hxx"
return ret;
}
+_PTR(AttributeParameter) SALOMEDS_Study::GetCommonParameters(const string& theID, int theSavePoint)
+{
+ SALOMEDSClient_AttributeParameter* AP = NULL;
+ if(_isLocal) AP = new SALOMEDS_AttributeParameter(_local_impl->GetCommonParameters(theID.c_str(), theSavePoint));
+ else AP = new SALOMEDS_AttributeParameter(_corba_impl->GetCommonParameters(theID.c_str(), theSavePoint));
+ return _PTR(AttributeParameter)(AP);
+}
+
+_PTR(AttributeParameter) SALOMEDS_Study::GetModuleParameters(const string& theID,
+ const string& theModuleName,
+ int theSavePoint)
+{
+ SALOMEDSClient_AttributeParameter* AP = NULL;
+ if(_isLocal) AP = new SALOMEDS_AttributeParameter(_local_impl->GetModuleParameters(theID.c_str(),
+ theModuleName.c_str(),
+ theSavePoint));
+ else AP = new SALOMEDS_AttributeParameter(_corba_impl->GetModuleParameters(theID.c_str(),
+ theModuleName.c_str(),
+ theSavePoint));
+ return _PTR(AttributeParameter)(AP);
+}
+
std::string SALOMEDS_Study::ConvertObjectToIOR(CORBA::Object_ptr theObject)
{
return _orb->object_to_string(theObject);
return SALOMEDS::Study::_nil();
}
+
virtual void Close();
virtual void EnableUseCaseAutoFilling(bool isEnabled);
virtual bool DumpStudy(const std::string& thePath, const std::string& theBaseName, bool isPublished);
-
+ virtual _PTR(AttributeParameter) GetCommonParameters(const std::string& theID, int theSavePoint);
+ virtual _PTR(AttributeParameter) GetModuleParameters(const std::string& theID,
+ const std::string& theModuleName, int theSavePoint);
std::string ConvertObjectToIOR(CORBA::Object_ptr theObject);
CORBA::Object_ptr ConvertIORToObject(const std::string& theIOR);
#include "SALOMEDS_UseCaseIterator_i.hxx"
#include "SALOMEDS_GenericAttribute_i.hxx"
#include "SALOMEDS_AttributeStudyProperties_i.hxx"
+#include "SALOMEDS_AttributeParameter_i.hxx"
#include "SALOMEDS_ChildIterator_i.hxx"
#include "SALOMEDS_Driver_i.hxx"
#include "SALOMEDS.hxx"
#include "SALOMEDSImpl_SComponent.hxx"
#include "SALOMEDSImpl_UseCaseBuilder.hxx"
#include "SALOMEDSImpl_AttributeStudyProperties.hxx"
+#include "SALOMEDSImpl_AttributeParameter.hxx"
#include "SALOMEDSImpl_ChildIterator.hxx"
#include <TColStd_SequenceOfExtendedString.hxx>
return ret;
}
+//============================================================================
+/*! Function : GetCommonParameters
+ * Purpose :
+ */
+//============================================================================
+SALOMEDS::AttributeParameter_ptr SALOMEDS_Study_i::GetCommonParameters(const char* theID, CORBA::Long theSavePoint)
+{
+ SALOMEDS::Locker lock;
+
+ Handle(SALOMEDSImpl_AttributeParameter) anAttr = _impl->GetCommonParameters(theID, theSavePoint);
+ SALOMEDS_AttributeParameter_i* SP = new SALOMEDS_AttributeParameter_i(anAttr, _orb);
+ return SP->AttributeParameter::_this();
+}
+
+//============================================================================
+/*! Function : GetCommonModuleParameters
+ * Purpose :
+ */
+//============================================================================
+SALOMEDS::AttributeParameter_ptr SALOMEDS_Study_i::GetModuleParameters(const char* theID,
+ const char* theModuleName,
+ CORBA::Long theSavePoint)
+{
+ SALOMEDS::Locker lock;
+
+ Handle(SALOMEDSImpl_AttributeParameter) anAttr = _impl->GetModuleParameters(theID, theModuleName, theSavePoint);
+ SALOMEDS_AttributeParameter_i* SP = new SALOMEDS_AttributeParameter_i(anAttr, _orb);
+ return SP->AttributeParameter::_this();
+}
+
//===========================================================================
// PRIVATE FUNCTIONS
//===========================================================================
// theWay = -1: get back to the list of postponed
#endif
+ virtual SALOMEDS::AttributeParameter_ptr GetCommonParameters(const char* theID, CORBA::Long theSavePoint);
+ virtual SALOMEDS::AttributeParameter_ptr GetModuleParameters(const char* theID,
+ const char* theModuleName,
+ CORBA::Long theSavePoint);
+
virtual CORBA::Boolean DumpStudy(const char* thePath, const char* theBaseName, CORBA::Boolean isPublished);
virtual Handle(SALOMEDSImpl_Study) GetImpl() { return _impl; }
public:
- virtual void SetInt(const int theID, const int& theValue) = 0;
- virtual int GetInt(const int theID) = 0;
+ virtual void SetInt(const std::string& theID, const int theValue) = 0;
+ virtual int GetInt(const std::string& theID) = 0;
- virtual void SetReal(const int theID, const double& theValue) = 0;
- virtual double GetReal(const int theID) = 0;
+ virtual void SetReal(const std::string& theID, const double& theValue) = 0;
+ virtual double GetReal(const std::string& theID) = 0;
- virtual void SetString(const int theID, const std::string& theValue) = 0;
- virtual std::string GetString(const int theID) = 0;
+ virtual void SetString(const std::string& theID, const std::string& theValue) = 0;
+ virtual std::string GetString(const std::string& theID) = 0;
- virtual void SetBool(const int theID, const bool& theValue) = 0;
- virtual bool GetBool(const int theID) = 0;
+ virtual void SetBool(const std::string& theID, const bool& theValue) = 0;
+ virtual bool GetBool(const std::string& theID) = 0;
- virtual void SetRealArray(const int theID, const std::vector<double>& theArray) = 0;
- virtual std::vector<double> GetRealArray(const int theID) = 0;
+ virtual void SetRealArray(const std::string& theID, const std::vector<double>& theArray) = 0;
+ virtual std::vector<double> GetRealArray(const std::string& theID) = 0;
- virtual void SetIntArray(const int theID, const std::vector<int>& theArray) = 0;
- virtual std::vector<int> GetIntArray(const int theID) = 0;
+ virtual void SetIntArray(const std::string& theID, const std::vector<int>& theArray) = 0;
+ virtual std::vector<int> GetIntArray(const std::string& theID) = 0;
- virtual void SetStrArray(const int theID, const std::vector<std::string>& theArray) = 0;
- virtual std::vector<std::string> GetStrArray(const int theID) = 0;
+ virtual void SetStrArray(const std::string& theID, const std::vector<std::string>& theArray) = 0;
+ virtual std::vector<std::string> GetStrArray(const std::string& theID) = 0;
- virtual bool IsSet(const int theID, const int theType) = 0;
+ virtual bool IsSet(const std::string& theID, const int theType) = 0;
- virtual bool RemoveID(const int theID, const int theType) = 0;
+ virtual bool RemoveID(const std::string& theID, const int theType) = 0;
virtual _PTR(AttributeParameter) GetFather() = 0;
virtual bool HasFather() = 0;
virtual void Clear() = 0;
- virtual std::vector<int> GetIDs(const int theType) = 0;
+ virtual std::vector<std::string> GetIDs(const int theType) = 0;
};
#endif
#include "SALOMEDSClient_definitions.hxx"
#include "SALOMEDSClient_SComponentIterator.hxx"
#include "SALOMEDSClient_StudyBuilder.hxx"
+#include "SALOMEDSClient_AttributeParameter.hxx"
#include "SALOMEDSClient_SObject.hxx"
#include "SALOMEDSClient_SComponent.hxx"
#include "SALOMEDSClient_UseCaseBuilder.hxx"
virtual void Close() = 0;
virtual void EnableUseCaseAutoFilling(bool isEnabled) = 0;
virtual bool DumpStudy(const std::string& thePath, const std::string& theBaseName, bool isPublished) = 0;
+ virtual _PTR(AttributeParameter) GetCommonParameters(const std::string& theID, int theSavePoint) = 0;
+ virtual _PTR(AttributeParameter) GetModuleParameters(const std::string& theID,
+ const std::string& theModuleName, int theSavePoint) = 0;
};
* Purpose : Associates a integer value with the ID
*/
//=======================================================================
-void SALOMEDSImpl_AttributeParameter::SetInt(const int theID, const int& theValue)
+void SALOMEDSImpl_AttributeParameter::SetInt(const string& theID, const int& theValue)
{
CheckLocked();
* Purpose : Returns a int value associated with the given ID
*/
//=======================================================================
-int SALOMEDSImpl_AttributeParameter::GetInt(const int theID)
+int SALOMEDSImpl_AttributeParameter::GetInt(const string& theID)
{
if(!IsSet(theID, PT_INTEGER)) Standard_Failure::Raise("Invalid ID");
return _ints[theID];
* Purpose : Associates a double value with the ID
*/
//=======================================================================
-void SALOMEDSImpl_AttributeParameter::SetReal(const int theID, const double& theValue)
+void SALOMEDSImpl_AttributeParameter::SetReal(const string& theID, const double& theValue)
{
CheckLocked();
* Purpose : Returns a double value associated with the given ID
*/
//=======================================================================
-double SALOMEDSImpl_AttributeParameter::GetReal(const int theID)
+double SALOMEDSImpl_AttributeParameter::GetReal(const string& theID)
{
if(!IsSet(theID, PT_REAL)) Standard_Failure::Raise("Invalid ID");
return _reals[theID];
* Purpose : Associates a string with the ID
*/
//=======================================================================
-void SALOMEDSImpl_AttributeParameter::SetString(const int theID, const TCollection_AsciiString& theValue)
+void SALOMEDSImpl_AttributeParameter::SetString(const string& theID, const string& theValue)
{
CheckLocked();
Backup();
- string s(theValue.ToCString());
- _strings[theID] = s;
+ _strings[theID] = theValue;
SetModifyFlag();
}
* Purpose : Returns a string associated with the given ID
*/
//=======================================================================
-TCollection_AsciiString SALOMEDSImpl_AttributeParameter::GetString(const int theID)
+string SALOMEDSImpl_AttributeParameter::GetString(const string& theID)
{
if(!IsSet(theID, PT_STRING)) Standard_Failure::Raise("Invalid ID");
- string s = _strings[theID];
- return TCollection_AsciiString((char*)s.c_str());
+ return _strings[theID];
}
//=======================================================================
* Purpose : Associates a bool value with the ID
*/
//=======================================================================
-void SALOMEDSImpl_AttributeParameter::SetBool(const int theID, const bool& theValue)
+void SALOMEDSImpl_AttributeParameter::SetBool(const string& theID, const bool& theValue)
{
CheckLocked();
* Purpose : Returns a bool value associated with the ID
*/
//=======================================================================
-bool SALOMEDSImpl_AttributeParameter::GetBool(const int theID)
+bool SALOMEDSImpl_AttributeParameter::GetBool(const string& theID)
{
if(!IsSet(theID, PT_BOOLEAN)) Standard_Failure::Raise("Invalid ID");
return _bools[theID];
* Purpose : Associates an array of double values with the given ID
*/
//=======================================================================
-void SALOMEDSImpl_AttributeParameter::SetRealArray(const int theID, const vector<double>& theArray)
+void SALOMEDSImpl_AttributeParameter::SetRealArray(const string& theID, const vector<double>& theArray)
{
CheckLocked();
* Purpose : Returns double values associated with the ID
*/
//=======================================================================
-vector<double> SALOMEDSImpl_AttributeParameter::GetRealArray(const int theID)
+vector<double> SALOMEDSImpl_AttributeParameter::GetRealArray(const string& theID)
{
if(!IsSet(theID, PT_REALARRAY)) Standard_Failure::Raise("Invalid ID");
return _realarrays[theID];
* Purpose : Associates an array of int values with the given ID
*/
//=======================================================================
-void SALOMEDSImpl_AttributeParameter::SetIntArray(const int theID, const vector<int>& theArray)
+void SALOMEDSImpl_AttributeParameter::SetIntArray(const string& theID, const vector<int>& theArray)
{
CheckLocked();
* Purpose : Returns int values associated with the ID
*/
//=======================================================================
-vector<int> SALOMEDSImpl_AttributeParameter::GetIntArray(const int theID)
+vector<int> SALOMEDSImpl_AttributeParameter::GetIntArray(const string& theID)
{
if(!IsSet(theID, PT_INTARRAY)) Standard_Failure::Raise("Invalid ID");
return _intarrays[theID];
* Purpose : Associates an array of string values with the given ID
*/
//=======================================================================
-void SALOMEDSImpl_AttributeParameter::SetStrArray(const int theID, const vector<string>& theArray)
+void SALOMEDSImpl_AttributeParameter::SetStrArray(const string& theID, const vector<string>& theArray)
{
CheckLocked();
* Purpose : Returns string values associated with the ID
*/
//=======================================================================
-vector<string> SALOMEDSImpl_AttributeParameter::GetStrArray(const int theID)
+vector<string> SALOMEDSImpl_AttributeParameter::GetStrArray(const string& theID)
{
if(!IsSet(theID, PT_STRARRAY)) Standard_Failure::Raise("Invalid ID");
return _strarrays[theID];
* a value in the attribute
*/
//=======================================================================
-bool SALOMEDSImpl_AttributeParameter::IsSet(const int theID, const Parameter_Types theType)
+bool SALOMEDSImpl_AttributeParameter::IsSet(const string& theID, const Parameter_Types theType)
{
switch(theType) {
case PT_INTEGER: {
* Purpose : Removes a parameter with given ID
*/
//=======================================================================
-bool SALOMEDSImpl_AttributeParameter::RemoveID(const int theID, const Parameter_Types theType)
+bool SALOMEDSImpl_AttributeParameter::RemoveID(const string& theID, const Parameter_Types theType)
{
Backup();
SetModifyFlag();
* Purpose : Returns an array of all ID's of the given type
*/
//=======================================================================
-vector<int> SALOMEDSImpl_AttributeParameter::GetIDs(const Parameter_Types theType)
+vector<string> SALOMEDSImpl_AttributeParameter::GetIDs(const Parameter_Types theType)
{
- vector<int> anArray;
+ vector<string> anArray;
int i = 0;
switch(theType) {
case PT_INTEGER: {
if(_ints.size()) {
anArray.resize(_ints.size());
- for(map<int,int>::const_iterator p = _ints.begin(); p != _ints.end(); p++, i++)
+ for(map<string,int>::const_iterator p = _ints.begin(); p != _ints.end(); p++, i++)
anArray[i] = p->first;
}
break;
case PT_REAL: {
if(_reals.size()) {
anArray.resize(_reals.size());
- for(map<int,double>::const_iterator p = _reals.begin(); p != _reals.end(); p++, i++)
+ for(map<string,double>::const_iterator p = _reals.begin(); p != _reals.end(); p++, i++)
anArray[i] = p->first;
}
break;
case PT_BOOLEAN: {
if(_bools.size()) {
anArray.resize(_bools.size());
- for(map<int,bool>::const_iterator p = _bools.begin(); p != _bools.end(); p++, i++)
+ for(map<string,bool>::const_iterator p = _bools.begin(); p != _bools.end(); p++, i++)
anArray[i] = p->first;
}
break;
case PT_STRING: {
if(_strings.size()) {
anArray.resize(_strings.size());
- for(map<int,string>::const_iterator p = _strings.begin(); p!= _strings.end(); p++)
+ for(map<string,string>::const_iterator p = _strings.begin(); p!= _strings.end(); p++)
anArray[i] = p->first;
}
break;
case PT_REALARRAY: {
if(_realarrays.size()) {
anArray.resize(_realarrays.size());
- for(map< int, vector<double> >::const_iterator p = _realarrays.begin(); p!= _realarrays.end(); p++)
+ for(map< string, vector<double> >::const_iterator p = _realarrays.begin(); p!= _realarrays.end(); p++)
anArray[i] = p->first;
}
break;
case PT_INTARRAY: {
if(_intarrays.size()) {
anArray.resize(_intarrays.size());
- for(map< int, vector<int> >::const_iterator p = _intarrays.begin(); p!= _intarrays.end(); p++)
+ for(map< string, vector<int> >::const_iterator p = _intarrays.begin(); p!= _intarrays.end(); p++)
anArray[i] = p->first;
}
break;
case PT_STRARRAY: {
if(_strarrays.size()) {
anArray.resize(_strarrays.size());
- for(map< int, vector<string> >::const_iterator p = _strarrays.begin(); p!= _strarrays.end(); p++)
+ for(map< string, vector<string> >::const_iterator p = _strarrays.begin(); p!= _strarrays.end(); p++)
anArray[i] = p->first;
}
break;
_intarrays.clear();
_strarrays.clear();
- for(map<int,int>::const_iterator p = A->_ints.begin(); p!= A->_ints.end(); p++) _ints[p->first] = p->second;
- for(map<int,double>::const_iterator p = A->_reals.begin(); p!= A->_reals.end(); p++) _reals[p->first] = p->second;
- for(map<int,bool>::const_iterator p = A->_bools.begin(); p!= A->_bools.end(); p++) _bools[p->first] = p->second;
- for(map<int,string>::const_iterator p = A->_strings.begin(); p!= A->_strings.end(); p++)
+ for(map<string,int>::const_iterator p = A->_ints.begin(); p!= A->_ints.end(); p++) _ints[p->first] = p->second;
+ for(map<string,double>::const_iterator p = A->_reals.begin(); p!= A->_reals.end(); p++) _reals[p->first] = p->second;
+ for(map<string,bool>::const_iterator p = A->_bools.begin(); p!= A->_bools.end(); p++) _bools[p->first] = p->second;
+ for(map<string,string>::const_iterator p = A->_strings.begin(); p!= A->_strings.end(); p++)
_strings[p->first] = p->second;
- for(map< int,vector<double> >::const_iterator p = A->_realarrays.begin(); p!= A->_realarrays.end(); p++)
+ for(map< string,vector<double> >::const_iterator p = A->_realarrays.begin(); p!= A->_realarrays.end(); p++)
_realarrays[p->first] = p->second;
- for(map< int,vector<int> >::const_iterator p = A->_intarrays.begin(); p!= A->_intarrays.end(); p++)
+ for(map< string,vector<int> >::const_iterator p = A->_intarrays.begin(); p!= A->_intarrays.end(); p++)
_intarrays[p->first] = p->second;
- for(map< int,vector<string> >::const_iterator p = A->_strarrays.begin(); p!= A->_strarrays.end(); p++)
+ for(map< string,vector<string> >::const_iterator p = A->_strarrays.begin(); p!= A->_strarrays.end(); p++)
_strarrays[p->first] = p->second;
}
buffer << _ints.size() << " ";
- for(map<int,int>::const_iterator p = _ints.begin(); p != _ints.end(); p++) {
- buffer << p->first << " " << p->second << " ";
+ for(map<string,int>::const_iterator p = _ints.begin(); p != _ints.end(); p++) {
+ buffer << convertString(p->first) << " " << p->second << " ";
}
buffer << _reals.size() << " ";
- for(map<int,double>::const_iterator p =_reals.begin(); p != _reals.end(); p++) {
+ for(map<string,double>::const_iterator p =_reals.begin(); p != _reals.end(); p++) {
sprintf(tmpBuffer, "%.64e", p->second);
- buffer << p->first << " " << tmpBuffer << " ";
+ buffer << convertString(p->first) << " " << tmpBuffer << " ";
}
buffer << _bools.size() << " ";
- for(map<int,bool>::const_iterator p = _bools.begin(); p != _bools.end(); p++) {
- buffer << p->first << " " << p->second << " ";
+ for(map<string,bool>::const_iterator p = _bools.begin(); p != _bools.end(); p++) {
+ buffer << convertString(p->first) << " " << p->second << " ";
}
buffer << _strings.size() << " ";
- for(map<int,string>::const_iterator p = _strings.begin(); p != _strings.end(); p++) {
- buffer << p->first << " " << convertString(p->second) << " ";
+ for(map<string,string>::const_iterator p = _strings.begin(); p != _strings.end(); p++) {
+ buffer << convertString(p->first) << " " << convertString(p->second) << " ";
}
buffer << _realarrays.size() << " ";
- for(map< int,vector<double> >::const_iterator p = _realarrays.begin(); p != _realarrays.end(); p++) {
+ for(map< string,vector<double> >::const_iterator p = _realarrays.begin(); p != _realarrays.end(); p++) {
vector<double> v(p->second);
- sprintf(tmpBuffer, " %d %d ", p->first, v.size());
+ sprintf(tmpBuffer, " %s %d ", convertString(p->first).c_str(), v.size());
buffer << tmpBuffer;
for(int i = 0; i<v.size(); i++) {
sprintf(tmpBuffer, " %.64e ", v[i]);
}
buffer << _intarrays.size() << " ";
- for(map< int,vector<int> >::const_iterator p = _intarrays.begin(); p != _intarrays.end(); p++) {
+ for(map< string,vector<int> >::const_iterator p = _intarrays.begin(); p != _intarrays.end(); p++) {
vector<int> v(p->second);
- sprintf(tmpBuffer, " %d %d ", p->first, v.size());
+ sprintf(tmpBuffer, " %s %d ", convertString(p->first).c_str(), v.size());
buffer << tmpBuffer;
for(int i = 0; i<v.size(); i++) {
sprintf(tmpBuffer, " %d ", v[i]);
}
buffer << _strarrays.size() << " ";
- for(map< int,vector<string> >::const_iterator p = _strarrays.begin(); p != _strarrays.end(); p++) {
+ for(map< string,vector<string> >::const_iterator p = _strarrays.begin(); p != _strarrays.end(); p++) {
vector<string> v(p->second);
- sprintf(tmpBuffer, " %d %d ", p->first, v.size());
+ sprintf(tmpBuffer, " %s %d ", convertString(p->first).c_str(), v.size());
buffer << tmpBuffer;
for(int i = 0; i<v.size(); i++) {
buffer << " " << convertString(v[i]) << " ";
istrstream buffer(theValue.ToCString(), strlen(theValue.ToCString()));
- int size, id, val, ival;
+ int size, val, ival;
double val2;
- string s;
+ string s, id;
buffer >> size;
for(int i = 1; i<=size; i++) {
buffer >> id >> val;
- _ints[id] = val;
+ _ints[restoreString(id)] = val;
}
buffer >> size;
for(int i = 1; i<=size; i++) {
buffer >> id >> val2;
- _reals[id] = val2;
+ _reals[restoreString(id)] = val2;
}
buffer >> size;
for(int i = 1; i<=size; i++) {
buffer >> id >> val;
- _bools[id] = val;
+ _bools[restoreString(id)] = val;
}
buffer >> size;
for(int i = 1; i<=size; i++) {
buffer >> id >> s;
- _strings[id] = restoreString(s);
+ _strings[restoreString(id)] = restoreString(s);
}
buffer >> size;
buffer >> val2;
v[j] = val2;
}
- _realarrays[id] = v;
+ _realarrays[restoreString(id)] = v;
}
buffer >> size;
buffer >> ival;
v[j] = ival;
}
- _intarrays[id] = v;
+ _intarrays[restoreString(id)] = v;
}
buffer >> size;
buffer >> s;
v[j] = restoreString(s);
}
- _strarrays[id] = v;
+ _strarrays[restoreString(id)] = v;
}
}
private:
- std::map<int, int> _ints;
- std::map<int, double> _reals;
- std::map<int, std::string> _strings;
- std::map<int, bool> _bools;
- std::map< int, vector<double> > _realarrays;
- std::map< int, vector<int> > _intarrays;
- std::map< int, vector<std::string> > _strarrays;
+ std::map<std::string, int> _ints;
+ std::map<std::string, double> _reals;
+ std::map<std::string, std::string> _strings;
+ std::map<std::string, bool> _bools;
+ std::map< std::string, vector<double> > _realarrays;
+ std::map< std::string, vector<int> > _intarrays;
+ std::map< std::string, vector<std::string> > _strarrays;
public:
Standard_EXPORT static const Standard_GUID& GetID() ;
Standard_EXPORT static Handle(SALOMEDSImpl_AttributeParameter) Set (const TDF_Label& L);
- Standard_EXPORT void SetInt(const int theID, const int& theValue);
- Standard_EXPORT int GetInt(const int theID);
+ Standard_EXPORT void SetInt(const std::string& theID, const int& theValue);
+ Standard_EXPORT int GetInt(const std::string& theID);
- Standard_EXPORT void SetReal(const int theID, const double& theValue);
- Standard_EXPORT double GetReal(const int theID);
+ Standard_EXPORT void SetReal(const std::string& theID, const double& theValue);
+ Standard_EXPORT double GetReal(const std::string& theID);
- Standard_EXPORT void SetString(const int theID, const TCollection_AsciiString& theValue);
- Standard_EXPORT TCollection_AsciiString GetString(const int theID);
+ Standard_EXPORT void SetString(const std::string& theID, const std::string& theValue);
+ Standard_EXPORT std::string GetString(const std::string& theID);
- Standard_EXPORT void SetBool(const int theID, const bool& theValue);
- Standard_EXPORT bool GetBool(const int theID);
+ Standard_EXPORT void SetBool(const std::string& theID, const bool& theValue);
+ Standard_EXPORT bool GetBool(const std::string& theID);
- Standard_EXPORT void SetRealArray(const int theID, const std::vector<double>& theArray);
- Standard_EXPORT std::vector<double> GetRealArray(const int theID);
+ Standard_EXPORT void SetRealArray(const std::string& theID, const std::vector<double>& theArray);
+ Standard_EXPORT std::vector<double> GetRealArray(const std::string& theID);
- Standard_EXPORT void SetIntArray(const int theID, const std::vector<int>& theArray);
- Standard_EXPORT std::vector<int> GetIntArray(const int theID);
+ Standard_EXPORT void SetIntArray(const std::string& theID, const std::vector<int>& theArray);
+ Standard_EXPORT std::vector<int> GetIntArray(const std::string& theID);
- Standard_EXPORT void SetStrArray(const int theID, const std::vector<std::string>& theArray);
- Standard_EXPORT std::vector<std::string> GetStrArray(const int theID);
+ Standard_EXPORT void SetStrArray(const std::string& theID, const std::vector<std::string>& theArray);
+ Standard_EXPORT std::vector<std::string> GetStrArray(const std::string& theID);
- Standard_EXPORT bool IsSet(const int theID, const Parameter_Types theType);
+ Standard_EXPORT bool IsSet(const std::string& theID, const Parameter_Types theType);
- Standard_EXPORT bool RemoveID(const int theID, const Parameter_Types theType);
+ Standard_EXPORT bool RemoveID(const std::string& theID, const Parameter_Types theType);
Standard_EXPORT Handle(SALOMEDSImpl_AttributeParameter) GetFather();
Standard_EXPORT bool HasFather();
Standard_EXPORT bool IsRoot();
- Standard_EXPORT std::vector<int> GetIDs(const Parameter_Types theType);
+ Standard_EXPORT std::vector<std::string> GetIDs(const Parameter_Types theType);
Standard_EXPORT void Clear();
if (aDriver != NULL) {
Handle(SALOMEDSImpl_StudyBuilder) SB = NewBuilder();
- cout << "Before SB" << endl;
if(!SB->LoadWith(sco, aDriver)) {
_errorCode = SB->GetErrorCode();
return false;
}
- cout << "After SB" << endl;
}
else continue;
}
_errorCode = "";
_doc->Modify();
}
+
+//============================================================================
+/*! Function :
+ * Purpose :
+ */
+//============================================================================
+Handle(SALOMEDSImpl_AttributeParameter) SALOMEDSImpl_Study::GetCommonParameters(const char* theID, int theSavePoint)
+{
+ Handle(SALOMEDSImpl_StudyBuilder) builder = NewBuilder();
+ Handle(SALOMEDSImpl_SObject) so = FindComponent((char*)theID);
+ if(so.IsNull()) so = builder->NewComponent((char*)theID);
+ Handle(SALOMEDSImpl_SObject) newSO = builder->NewObjectToTag(so, theSavePoint);
+ return Handle(SALOMEDSImpl_AttributeParameter)::DownCast(builder->FindOrCreateAttribute(newSO, "AttributeParameter"));
+}
+
+//============================================================================
+/*! Function :
+ * Purpose :
+ */
+//============================================================================
+Handle(SALOMEDSImpl_AttributeParameter) SALOMEDSImpl_Study::GetModuleParameters(const char* theID,
+ const char* theModuleName,
+ int theSavePoint)
+{
+ Handle(SALOMEDSImpl_AttributeParameter) main_ap = GetCommonParameters(theID, theSavePoint);
+ Handle(SALOMEDSImpl_SObject) main_so = main_ap->GetSObject();
+ Handle(SALOMEDSImpl_AttributeParameter) par;
+
+ Handle(SALOMEDSImpl_ChildIterator) it = NewChildIterator(main_so);
+ string moduleName(theModuleName);
+ for(; it->More(); it->Next()) {
+ Handle(SALOMEDSImpl_SObject) so(it->Value());
+ Handle(SALOMEDSImpl_GenericAttribute) ga;
+ if(so->FindAttribute(ga, "AttributeParameter")) {
+ par = Handle(SALOMEDSImpl_AttributeParameter)::DownCast(ga);
+ if(!par->IsSet("AP_MODULE_NAME", (Parameter_Types)3)) continue; //3 -> PT_STRING
+ if(par->GetString("AP_MODULE_NAME") == moduleName) return par;
+ }
+ }
+
+ Handle(SALOMEDSImpl_StudyBuilder) builder = NewBuilder();
+ Handle(SALOMEDSImpl_SObject) so = builder->NewObject(main_so);
+ par = Handle(SALOMEDSImpl_AttributeParameter)::DownCast(builder->FindOrCreateAttribute(so, "AttributeParameter"));
+ par->SetString("AP_MODULE_NAME", moduleName);
+ return par;
+}
#include "SALOMEDSImpl_UseCaseBuilder.hxx"
#include "SALOMEDSImpl_AttributeStudyProperties.hxx"
#include "SALOMEDSImpl_AttributeIOR.hxx"
+#include "SALOMEDSImpl_AttributeParameter.hxx"
#include "SALOMEDSImpl_Callback.hxx"
#include "SALOMEDSImpl_Driver.hxx"
#include "SALOMEDSImpl_ChildIterator.hxx"
//This method marks the study as being modified
Standard_EXPORT void Modify();
+ Standard_EXPORT Handle(SALOMEDSImpl_AttributeParameter) GetCommonParameters(const char* theID, int theSavePoint);
+
+ Standard_EXPORT Handle(SALOMEDSImpl_AttributeParameter) GetModuleParameters(const char* theID,
+ const char* theModuleName,
+ int theSavePoint);
+
public:
DEFINE_STANDARD_RTTI( SALOMEDSImpl_Study )
cout << "AttributeParameter with type : " << AP->Type() << endl;
- AP->SetInt(1, 123);
- cout << "IsSet for int: " << AP->IsSet(1, PT_INTEGER) << " value : " << AP->GetInt(1) << endl;
- for(int i = 2; i < 5; i++) AP->SetInt(i, i*i);
+ AP->SetInt("1", 123);
+ cout << "IsSet for int: " << AP->IsSet("1", PT_INTEGER) << " value : " << AP->GetInt("1") << endl;
+ //for(int i = 2; i < 5; i++) AP->SetInt(i, i*i);
- AP->SetReal(1, 123.123);
- cout << "IsSet for real: " << AP->IsSet(1, PT_REAL) << " value : " << AP->GetReal(1) << endl;
- for(int i = 2; i < 5; i++) AP->SetReal(i, 0.1);
+ AP->SetReal("1", 123.123);
+ cout << "IsSet for real: " << AP->IsSet("1", PT_REAL) << " value : " << AP->GetReal("1") << endl;
+ //for(int i = 2; i < 5; i++) AP->SetReal(i, 0.1);
- AP->SetString(1, "value is 123.123!");
- cout << "IsSet for string: " << AP->IsSet(1, PT_STRING) << " value : " << AP->GetString(1) << endl;
+ AP->SetString("1", "value is 123.123!");
+ cout << "IsSet for string: " << AP->IsSet("1", PT_STRING) << " value : " << AP->GetString("1") << endl;
+ /*
for(int i = 2; i < 5; i++) {
TCollection_AsciiString s((double)(1.0/i));
cout << "Setting for " << i << " value : " << s << endl;
AP->SetString(i, s);
}
+ */
- AP->SetBool(1, true);
- cout << "IsSet for bool: " << AP->IsSet(1, PT_BOOLEAN) << " value : " << AP->GetBool(1) << endl;
- for(int i = 2; i < 5; i++) AP->SetBool(i, 0);
+ AP->SetBool("1", true);
+ cout << "IsSet for bool: " << AP->IsSet("1", PT_BOOLEAN) << " value : " << AP->GetBool("1") << endl;
+ //for(int i = 2; i < 5; i++) AP->SetBool(i, 0);
vector<double> v;
v.push_back(111.111);
v.push_back(222.22222);
v.push_back(333.3333333);
- AP->SetRealArray(1, v);
- cout << "IsSet for array: " << AP->IsSet(1, PT_REALARRAY);
- vector<double> v2 = AP->GetRealArray(1);
+ AP->SetRealArray("1", v);
+ cout << "IsSet for array: " << AP->IsSet("1", PT_REALARRAY);
+ vector<double> v2 = AP->GetRealArray("1");
cout.precision(10);
cout << " values : ";
for(int i = 0; i<v2.size(); i++) cout << v2[i] << " ";
v[0] = 211.111;
v[1] = 422.22222;
v[2] = 633.3333333;
- AP->SetRealArray(2, v);
+ AP->SetRealArray("2", v);
vector<int> vi;
vi.push_back(1);
vi.push_back(2);
- AP->SetIntArray(2, vi);
+ AP->SetIntArray("2", vi);
vector<string> vs;
vs.push_back("hello, ");
vs.push_back("world!");
- AP->SetStrArray(3, vs);
+ AP->SetStrArray("3", vs);
TCollection_AsciiString as = AP->Save();
cout << "AS = " << as << endl;
AP->Load(as);
- cout << "Restored string with id = 1 is: " << AP->GetString(1) << endl;
- cout << "Restored int with id = 2 is: " << AP->GetInt(2) << endl;
- cout << "Restored real with id = 3 is: " << AP->GetReal(3) << endl;
- cout << "Restored bool with id = 1 is: " << AP->GetBool(1) << endl;
+ cout << "Restored string with id = 1 is: " << AP->GetString("1") << endl;
+ cout << "Restored int with id = 2 is: " << AP->GetInt("1") << endl;
+ cout << "Restored real with id = 3 is: " << AP->GetReal("1") << endl;
+ cout << "Restored bool with id = 1 is: " << AP->GetBool("1") << endl;
- v2 = AP->GetRealArray(2);
+ v2 = AP->GetRealArray("2");
cout << "Restored real array with id = 2 is: ";
for(int i = 0; i<v2.size(); i++) cout << v2[i] << " ";
cout << endl;
- vi = AP->GetIntArray(2);
+ vi = AP->GetIntArray("2");
cout << "Restored int array with id = 2 is: ";
for(int i = 0; i<vi.size(); i++) cout << vi[i] << " ";
cout << endl;
- vs = AP->GetStrArray(3);
+ vs = AP->GetStrArray("3");
cout << "Restored string array with id = 2 is: ";
for(int i = 0; i<vs.size(); i++) cout << vs[i] << " ";
cout << endl;
cout << "Check RemoveID 1 with type PT_INTEGER" << endl;
- AP->RemoveID(1, PT_INTEGER);
- cout << "IsSet with id = 1, type = PT_INTEGER : " << AP->IsSet(1, PT_INTEGER) << endl;
+ AP->RemoveID("1", PT_INTEGER);
+ cout << "IsSet with id = 1, type = PT_INTEGER : " << AP->IsSet("1", PT_INTEGER) << endl;
cout << "Check RemoveID is done" << endl;
cout << "Check AttributeParameter : done" << endl;