29 #define BCAP_GET_OBJECT_ARGS (3) 30 #define BCAP_GET_OBJECTNAMES_ARGS (2) 64 std::string tmpName =
m_name;
67 std::replace(tmpName.begin(), tmpName.end(),
' ',
'_');
70 std::replace(tmpName.begin(), tmpName.end(),
'\\',
'/');
74 while((c = tmpName.find_first_of(
"@")) != std::string::npos) {
79 while((c = tmpName.find_first_of(
"*")) != std::string::npos) {
87 const std::string& name,
89 int16_t vt,
bool bRead,
bool bWrite,
bool bID,
int iDuration)
92 vecBase.insert(vecBase.end(), vecVar.begin(), vecVar.end());
101 vt, bRead, bWrite, bID, iDuration));
103 vecVar.push_back(var);
117 bool bRead =
false, bWrite =
false, bID =
false;
123 if(chTmp != NULL) vt = atoi(chTmp);
126 if(chTmp != NULL) bRead = (strcasecmp(chTmp,
"true") == 0);
129 if(chTmp != NULL) bWrite = (strcasecmp(chTmp,
"true") == 0);
132 if(chTmp != NULL) bID = (strcasecmp(chTmp,
"true") == 0);
135 if(chTmp != NULL) iDuration = atoi(chTmp);
143 vt, bRead, bWrite, bID, iDuration));
145 vecVar.push_back(var);
151 int32_t get_id,
const std::string& name,
182 vntArgs.push_back(*vntTmp.get());
185 hr =
m_vecService[srvs]->ExecFunction(get_id, vntArgs, vntRet);
188 vecHandle.push_back(vntRet->ulVal);
215 vntArgs.push_back(*vntTmp.get());
226 for(i = 0; i < num; i++) {
232 num = vntRet->parray->rgsabound->cElements;
234 for(i = 0; i < num; i++){
257 *obj = vecBase.at(index);
259 }
catch (std::out_of_range&) {
269 DensoBase_Vec::const_iterator it;
270 for(it = vecBase.begin(); it != vecBase.end(); it++) {
271 if(!strcasecmp((*it)->Name().c_str(), name.c_str())) {
HRESULT SafeArrayUnaccessData(SAFEARRAY *psa)
HRESULT AddVariable(int32_t get_id, const std::string &name, std::vector< boost::shared_ptr< class DensoVariable > > &vecVar, int16_t vt=VT_EMPTY, bool bRead=false, bool bWrite=false, bool bID=false, int iDuration=BCAP_VAR_DEFAULT_DURATION)
std::vector< VARIANT, VariantAllocator< VARIANT > > VARIANT_Vec
std::vector< uint32_t > Handle_Vec
HRESULT GetObjectNames(int32_t func_id, Name_Vec &vecName)
void VariantInit(VARIANT *pvarg)
BSTR SysAllocString(const wchar_t *sz)
static std::string ConvertBSTRToString(const BSTR bstr)
const char * Attribute(const char *name, const char *value=0) const
std::vector< DensoVariable_Ptr > DensoVariable_Vec
const char * GetText() const
boost::interprocess::unique_ptr< VARIANT, variant_deleter > VARIANT_Ptr
HRESULT SafeArrayAccessData(SAFEARRAY *psa, void **ppvData)
static BSTR ConvertStringToBSTR(const std::string &str)
#define XML_ATTR_DURATION
HRESULT get_Object(const std::vector< boost::shared_ptr< DensoBase > > &vecBase, int index, boost::shared_ptr< DensoBase > *obj)
std::vector< std::string > Name_Vec
#define BCAP_GET_OBJECTNAMES_ARGS
SAFEARRAYBOUND rgsabound[1]
std::vector< DensoBase_Ptr > DensoBase_Vec
std::string RosName() const
#define BCAP_GET_OBJECT_ARGS
#define BCAP_VAR_DEFAULT_DURATION
_DN_EXP_COMMON char * ConvertWideChar2MultiByte(const wchar_t *chSrc)
HRESULT AddObject(int32_t get_id, const std::string &name, Handle_Vec &vecHandle)
_DN_EXP_COMMON wchar_t * ConvertMultiByte2WideChar(const char *chSrc)