to set an attribute value (of type string) without creating the intermediate Attribute object (faster)
*/
string GetIOR();
+/*!
+ Set an attribute value (of type string)
+ \param name the name of the attribute
+ \param value the value of the attribute
+*/
+ void SetAttrString(in string name, in string value);
+
/*!
Private method, returns an implementation of this SObject.
\param theHostname is a hostname of the caller
#include "SALOME_Basics.hxx"
#include <string>
+#include <iostream>
+#include <sys/time.h>
namespace Kernel_Utils
{
BASICS_EXPORT std::string GetGUID( GUIDtype );
}
+#define START_TIMING(name) static long name##tcount=0;static long name##cumul;long name##tt0; timeval name##tv; gettimeofday(&name##tv,0); \
+ name##tt0=name##tv.tv_usec+name##tv.tv_sec*1000000; \
+ if(name##tcount==0)std::cerr<<__FILE__<<":"<<__LINE__<<":"<<#name<<std::endl;
+
+#define END_TIMING(name,NUMBER) name##tcount=name##tcount+1;gettimeofday(&name##tv,0); \
+ name##cumul=name##cumul+name##tv.tv_usec+name##tv.tv_sec*1000000 -name##tt0; \
+ if(name##tcount==NUMBER){ \
+ std::cerr <<__FILE__<<":"<<__LINE__<<":"<<#name<<" temps CPU(mus): "<< name##cumul<<std::endl; \
+ name##tcount=0;name##cumul=0;}
+
#endif //_Basics_UTILS_HXX_
ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
_orb = init(0 , 0 ) ;
}
+
+void SALOMEDS_SObject::SetAttrString(const std::string& name, const std::string& value)
+{
+ if(_isLocal)
+ {
+ SALOMEDS::Locker lock;
+ _local_impl->SetAttrString(name,value);
+ }
+ else
+ {
+ _corba_impl->SetAttrString(name.c_str(),value.c_str());
+ }
+}
virtual std::string GetName();
virtual std::string GetComment();
virtual std::string GetIOR();
+ virtual void SetAttrString(const std::string& name, const std::string& value);
virtual int Tag();
virtual int Depth();
return aStr._retn();
}
+//============================================================================
+/*! Function : SetAttrString
+ * Purpose :
+ */
+//============================================================================
+void SALOMEDS_SObject_i::SetAttrString(const char* name, const char* value)
+{
+ SALOMEDS::Locker lock;
+ _impl->SetAttrString(name,value);
+}
+
//===========================================================================
// PRIVATE FUNCTIONS
//===========================================================================
virtual char* GetName();
virtual char* GetComment();
virtual char* GetIOR();
+ virtual void SetAttrString(const char*, const char*);
virtual CORBA::Short Tag();
virtual CORBA::Short Depth();
void IORGenericObjDecref(const std::string& anIOR)
{
+ if(anIOR=="")return;
CORBA::Object_var obj;
SALOME::GenericObj_var gobj;
try
return SALOMEDSImpl_SComponent::IsA(_lab);
}
+void SALOMEDSImpl_SObject::SetAttrString(const std::string& name, const std::string& value)
+{
+ if(name=="AttributeName")SALOMEDSImpl_AttributeName::Set(GetLabel(), value);
+ else if(name=="AttributeIOR")SALOMEDSImpl_AttributeIOR::Set(GetLabel(), value);
+ else if(name=="AttributeString")SALOMEDSImpl_AttributeString::Set(GetLabel(), value);
+ else if(name=="AttributePixMap")SALOMEDSImpl_AttributePixMap::Set(GetLabel(), value);
+}
virtual std::string GetName() const ;
virtual std::string GetComment() const;
virtual std::string GetIOR() const;
+ virtual void SetAttrString(const std::string& name,const std::string& value);
virtual int Tag() const { return _lab.Tag(); }
virtual int Depth() const { return _lab.Depth(); }