Skip to content
Snippets Groups Projects
Commit 8cd08360 authored by Graziano Scalamera's avatar Graziano Scalamera
Browse files

Merge branch 'test_ci' into 'master'

Test ci

See merge request graziano.scalamera/alarm-handler!1
parents a2e191bb 6b6f1ee9
No related branches found
Tags 1.0.0
No related merge requests found
This diff is collapsed.
/*----- PROTECTED REGION ID(TestDevice.h) ENABLED START -----*/
//=============================================================================
//
// file : TestDevice.h
//
// description : Include for the TestDevice class.
//
// $Author: graziano $
//
//
//=============================================================================
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//=============================================================================
#ifndef TestDevice_H
#define TestDevice_H
#include <tango.h>
#define MAX_ATTR_SIZE 3000
#define MAX_SPECTRUM_SIZE 100
/*----- PROTECTED REGION END -----*/
/**
* TestDevice class Description:
*
*/
namespace TestDevice_ns
{
/*----- PROTECTED REGION ID(TestDevice::Additional Class Declarations) ENABLED START -----*/
// Additional Class Declarations
typedef struct {
void *value; //pointer to values
unsigned int size1; //actual size of dimension 1
unsigned int size2; //actual size of dimension 2
unsigned int max1; //max size of dimension 1
unsigned int max2; //max size of dimension 2
long type; //data type
unsigned char cmd_attr_type; //if data for attribute or for command
struct timeval ts;
} map_data_t;
enum { typeDouble, typeLong, typeBool, typeString, typeUchar};
/*----- PROTECTED REGION END -----*/ // TestDevice::Additional Class Declarations
class TestDevice : public TANGO_BASE_CLASS
{
friend class CmdClass;
/*----- PROTECTED REGION ID(TestDevice::Data Members) ENABLED START -----*/
// Add your own data members
protected:
map<std::string,map_data_t> attr_data_map;
void string_explode(string, string, vector<string>*);
void save_configuration();
void create_dynamic_attribute(vector<string> config);
long create_dynamic_command(const char* cmd_name, Tango::CmdArgType type_in, Tango::CmdArgType type_out, long size_in, long size_out);
template <typename Attr_type> void set_write_value(Attr_type *value, string attrname, long x = 1);
void set_write_value(Tango::DevString value, string attrname);
timeval last_read;
int numAttr;
char ref_array[1024][256];
double dlastDB;
bool waitingDB;
//Tango::DevString ref_ptr[1024];
/*----- PROTECTED REGION END -----*/ // TestDevice::Data Members
// Device property data members
public:
// Attr_config:
vector<string> attr_config;
// MinSaveDBPeriod:
Tango::DevLong minSaveDBPeriod;
// Attribute data members
public:
Tango::DevString *attr_ScalarDyn_read;
Tango::DevString attr_ScalarDyn_write;
Tango::DevDouble *attr_Ref_read;
Tango::DevString *attr_Values_read;
// Constructors and destructors
public:
/**
* Constructs a newly allocated Command object.
*
* @param cl Class.
* @param s Device Name
*/
TestDevice(Tango::DeviceClass *cl,string &s);
/**
* Constructs a newly allocated Command object.
*
* @param cl Class.
* @param s Device Name
*/
TestDevice(Tango::DeviceClass *cl,const char *s);
/**
* Constructs a newly allocated Command object.
*
* @param cl Class.
* @param s Device name
* @param d Device description.
*/
TestDevice(Tango::DeviceClass *cl,const char *s,const char *d);
/**
* The object destructor.
*/
~TestDevice() {delete_device();};
// Miscellaneous methods
public:
/**
* will be called at device destruction or at init command.
*/
void delete_device();
/**
* Initialize the device
*/
virtual void init_device();
/**
* Read the device properties from database
*/
void get_device_property();
/**
* Always executed method before execution command method.
*/
virtual void always_executed_hook();
// Attribute methods
public:
/**
* Method : TestDevice::read_attr_hardware()
* Description : Hardware acquisition for attributes.
*/
virtual void read_attr_hardware(vector<long> &attr_list);
/**
* ScalarDyn attribute related methods.
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
virtual void read_ScalarDyn(Tango::Attribute &attr);
virtual void write_ScalarDyn(Tango::WAttribute &attr);
virtual bool is_ScalarDyn_allowed(Tango::AttReqType type);
/**
* SpectrumDyn attribute related methods.
* Description:
*
* Data type: Tango::DevString
* Attr type: Spectrum
*/
virtual void read_SpectrumDyn(Tango::Attribute &attr);
virtual void write_SpectrumDyn(Tango::WAttribute &attr);
virtual bool is_SpectrumDyn_allowed(Tango::AttReqType type);
/**
* Ref attribute related methods.
* Description:
*
* Data type: Tango::DevDouble
* Attr type: Spectrum
*/
virtual void read_Ref(Tango::Attribute &attr);
virtual void write_Ref(Tango::WAttribute &attr);
virtual bool is_Ref_allowed(Tango::AttReqType type);
/**
* Values attribute related methods.
* Description:
*
* Data type: Tango::DevString
* Attr type: Spectrum
*/
virtual void read_Values(Tango::Attribute &attr);
virtual void write_Values(Tango::WAttribute &attr);
virtual bool is_Values_allowed(Tango::AttReqType type);
/**
* Method : TestDevice::add_dynamic_attributes()
* Description : Add dynamic attributes if any.
*/
void add_dynamic_attributes();
// Command related methods
public:
/**
* Command WriteAttrname related methods.
*/
void write_attrname(const Tango::DevVarDoubleStringArray *);
virtual bool is_WriteAttrname_allowed(const CORBA::Any &any);
/**
* Command ReadAttrname related methods.
*/
Tango::DevVarDoubleArray *read_attrname(const Tango::DevVarStringArray *);
virtual bool is_ReadAttrname_allowed(const CORBA::Any &any);
/**
* Command Config related methods.
*/
void config(const Tango::DevVarStringArray *);
virtual bool is_Config_allowed(const CORBA::Any &any);
/**
* Command Add related methods.
*/
void add(const Tango::DevVarStringArray *);
virtual bool is_Add_allowed(const CORBA::Any &any);
/**
* Command AddDouble related methods.
*/
void add_double(const Tango::DevVarStringArray *);
virtual bool is_AddDouble_allowed(const CORBA::Any &any);
/**
* Command AddLong related methods.
*/
void add_long(const Tango::DevVarStringArray *);
virtual bool is_AddLong_allowed(const CORBA::Any &any);
/**
* Command AddBool related methods.
*/
void add_bool(const Tango::DevVarStringArray *);
virtual bool is_AddBool_allowed(const CORBA::Any &any);
/**
* Command AddString related methods.
*/
void add_string(const Tango::DevVarStringArray *);
virtual bool is_AddString_allowed(const CORBA::Any &any);
/**
* Command Remove related methods.
*/
void remove(const Tango::DevVarStringArray *);
virtual bool is_Remove_allowed(const CORBA::Any &any);
/*----- PROTECTED REGION ID(TestDevice::Additional Method prototypes) ENABLED START -----*/
// Additional Method prototypes
/*----- PROTECTED REGION END -----*/ // TestDevice::Additional Method prototypes
};
/*----- PROTECTED REGION ID(TestDevice::Additional Classes Definitions) ENABLED START -----*/
// Additional Classes definitions
class CmdClass : public Tango::Command
{
public:
CmdClass(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out,
const char *in_desc,
const char *out_desc,
Tango::DispLevel level,
int size_in,
Tango::DeviceImpl *dev)
:Command(name,in,out,in_desc,out_desc, level) {_max_in=size_in; mydevice=(TestDevice *)dev;};
CmdClass(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out,
int size_in,
Tango::DeviceImpl *dev)
:Command(name,in,out) {_max_in=size_in; mydevice=(TestDevice *)dev;};
~CmdClass() {};
virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any);
virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any)
{return true/*(static_cast<TangoLib *>(dev))->is_Cmd_allowed(any)*/;}
int _max_in;
TestDevice *mydevice;
};
/*----- PROTECTED REGION END -----*/ // TestDevice::Additional Classes Definitions
} // namespace
#endif // TestDevice_H
This diff is collapsed.
/*----- PROTECTED REGION ID(TestDeviceClass.h) ENABLED START -----*/
//=============================================================================
//
// file : TestDeviceClass.h
//
// description : Include for the TestDeviceClass root class.
// This class is the singleton class for.
// the TestDevice device class..
// It contains all properties and methods which the .
// TestDevice requires only once e.g. the commands.
//
// $Author: graziano $
//
//
//
//=============================================================================
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//=============================================================================
#ifndef TestDeviceCLASS_H
#define TestDeviceCLASS_H
#include <tango.h>
#include <TestDevice.h>
/*----- PROTECTED REGION END -----*/
namespace TestDevice_ns
{
/*----- PROTECTED REGION ID(TestDevice::classes for dynamic creation) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // TestDevice::classes for dynamic creation
//=========================================
// Define classes for attributes
//=========================================
class SpectrumDynAttrib: public Tango::SpectrumAttr
{
public:
SpectrumDynAttrib():SpectrumAttr("SpectrumDyn",
Tango::DEV_DOUBLE, Tango::READ_WRITE, MAX_SPECTRUM_SIZE) {};
~SpectrumDynAttrib() {};
SpectrumDynAttrib(const string &att_name, long data_type, long s_size):SpectrumAttr(att_name.c_str(),
data_type, Tango::READ_WRITE, s_size) {};
virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att)
{(static_cast<TestDevice *>(dev))->read_SpectrumDyn(att);}
virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att)
{(static_cast<TestDevice *>(dev))->write_SpectrumDyn(att);}
virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty)
{return (static_cast<TestDevice *>(dev))->is_SpectrumDyn_allowed(ty);}
};
class ScalarDynAttrib: public Tango::Attr
{
public:
ScalarDynAttrib():Attr("ScalarDyn",
Tango::DEV_STRING, Tango::READ_WRITE) {};
~ScalarDynAttrib() {};
ScalarDynAttrib(const string &att_name, long data_type):Attr(att_name.c_str(),
data_type, Tango::READ_WRITE) {};
virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att)
{(static_cast<TestDevice *>(dev))->read_ScalarDyn(att);}
virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att)
{(static_cast<TestDevice *>(dev))->write_ScalarDyn(att);}
virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty)
{return (static_cast<TestDevice *>(dev))->is_ScalarDyn_allowed(ty);}
};
class RefAttrib: public Tango::SpectrumAttr
{
public:
RefAttrib():SpectrumAttr("Ref", Tango::DEV_DOUBLE, Tango::READ_WRITE, 1024) {};
~RefAttrib() {};
virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att)
{(static_cast<TestDevice *>(dev))->read_Ref(att);}
virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att)
{(static_cast<TestDevice *>(dev))->write_Ref(att);}
virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty)
{return (static_cast<TestDevice *>(dev))->is_Ref_allowed(ty);}
};
class ValuesAttrib: public Tango::SpectrumAttr
{
public:
ValuesAttrib():SpectrumAttr("Values", Tango::DEV_STRING, Tango::READ_WRITE, 1024) {};
~ValuesAttrib() {};
virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att)
{(static_cast<TestDevice *>(dev))->read_Values(att);}
virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att)
{(static_cast<TestDevice *>(dev))->write_Values(att);}
virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty)
{return (static_cast<TestDevice *>(dev))->is_Values_allowed(ty);}
};
//=========================================
// Define classes for commands
//=========================================
class WriteAttrnameClass : public Tango::Command
{
public:
WriteAttrnameClass(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out,
const char *in_desc,
const char *out_desc,
Tango::DispLevel level)
:Command(name,in,out,in_desc,out_desc, level) {};
WriteAttrnameClass(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out)
:Command(name,in,out) {};
~WriteAttrnameClass() {};
virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any);
virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any)
{return (static_cast<TestDevice *>(dev))->is_WriteAttrname_allowed(any);}
};
class ReadAttrnameClass : public Tango::Command
{
public:
ReadAttrnameClass(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out,
const char *in_desc,
const char *out_desc,
Tango::DispLevel level)
:Command(name,in,out,in_desc,out_desc, level) {};
ReadAttrnameClass(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out)
:Command(name,in,out) {};
~ReadAttrnameClass() {};
virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any);
virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any)
{return (static_cast<TestDevice *>(dev))->is_ReadAttrname_allowed(any);}
};
class ConfigClass : public Tango::Command
{
public:
ConfigClass(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out,
const char *in_desc,
const char *out_desc,
Tango::DispLevel level)
:Command(name,in,out,in_desc,out_desc, level) {};
ConfigClass(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out)
:Command(name,in,out) {};
~ConfigClass() {};
virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any);
virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any)
{return (static_cast<TestDevice *>(dev))->is_Config_allowed(any);}
};
class AddClass : public Tango::Command
{
public:
AddClass(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out,
const char *in_desc,
const char *out_desc,
Tango::DispLevel level)
:Command(name,in,out,in_desc,out_desc, level) {};
AddClass(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out)
:Command(name,in,out) {};
~AddClass() {};
virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any);
virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any)
{return (static_cast<TestDevice *>(dev))->is_Add_allowed(any);}
};
class AddDoubleClass : public Tango::Command
{
public:
AddDoubleClass(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out,
const char *in_desc,
const char *out_desc,
Tango::DispLevel level)
:Command(name,in,out,in_desc,out_desc, level) {};
AddDoubleClass(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out)
:Command(name,in,out) {};
~AddDoubleClass() {};
virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any);
virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any)
{return (static_cast<TestDevice *>(dev))->is_AddDouble_allowed(any);}
};
class AddLongClass : public Tango::Command
{
public:
AddLongClass(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out,
const char *in_desc,
const char *out_desc,
Tango::DispLevel level)
:Command(name,in,out,in_desc,out_desc, level) {};
AddLongClass(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out)
:Command(name,in,out) {};
~AddLongClass() {};
virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any);
virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any)
{return (static_cast<TestDevice *>(dev))->is_AddLong_allowed(any);}
};
class AddBoolClass : public Tango::Command
{
public:
AddBoolClass(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out,
const char *in_desc,
const char *out_desc,
Tango::DispLevel level)
:Command(name,in,out,in_desc,out_desc, level) {};
AddBoolClass(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out)
:Command(name,in,out) {};
~AddBoolClass() {};
virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any);
virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any)
{return (static_cast<TestDevice *>(dev))->is_AddBool_allowed(any);}
};
class AddStringClass : public Tango::Command
{
public:
AddStringClass(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out,
const char *in_desc,
const char *out_desc,
Tango::DispLevel level)
:Command(name,in,out,in_desc,out_desc, level) {};
AddStringClass(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out)
:Command(name,in,out) {};
~AddStringClass() {};
virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any);
virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any)
{return (static_cast<TestDevice *>(dev))->is_AddString_allowed(any);}
};
class RemoveClass : public Tango::Command
{
public:
RemoveClass(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out,
const char *in_desc,
const char *out_desc,
Tango::DispLevel level)
:Command(name,in,out,in_desc,out_desc, level) {};
RemoveClass(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out)
:Command(name,in,out) {};
~RemoveClass() {};
virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any);
virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any)
{return (static_cast<TestDevice *>(dev))->is_Remove_allowed(any);}
};
/**
* The TemplateDevServClass singleton definition
*/
class
#ifdef _TG_WINDOWS_
__declspec(dllexport)
#endif
TestDeviceClass : public Tango::DeviceClass
{
/*----- PROTECTED REGION ID(TestDevice::Additionnal DServer data members) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // TestDevice::Additionnal DServer data members
public:
// write class properties data members
Tango::DbData cl_prop;
Tango::DbData cl_def_prop;
Tango::DbData dev_def_prop;
// Method prototypes
static TestDeviceClass *init(const char *);
static TestDeviceClass *instance();
~TestDeviceClass();
Tango::DbDatum get_class_property(string &);
Tango::DbDatum get_default_device_property(string &);
Tango::DbDatum get_default_class_property(string &);
protected:
TestDeviceClass(string &);
static TestDeviceClass *_instance;
void command_factory();
void attribute_factory(vector<Tango::Attr *> &);
void write_class_property();
void set_default_property();
void get_class_property();
string get_cvstag();
string get_cvsroot();
private:
void device_factory(const Tango::DevVarStringArray *);
void create_static_attribute_list(vector<Tango::Attr *> &);
void erase_dynamic_attributes(const Tango::DevVarStringArray *,vector<Tango::Attr *> &);
vector<string> defaultAttList;
};
} // namespace
#endif // TestDeviceCLASS_H
/*----- PROTECTED REGION ID(TestDeviceStateMachine.cpp) ENABLED START -----*/
//=============================================================================
//
// file : TestDeviceStateMachine.cpp
//
// description : C++ source for the �name� and its alowed
// methods for commands and attributes
//
// $Author: graziano $
//
//
//
//=============================================================================
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//=============================================================================
#include <TestDevice.h>
#include <TestDeviceClass.h>
/*----- PROTECTED REGION END -----*/
/*
* TestDevice states description:
*
*/
namespace TestDevice_ns
{
//=================================================
// Attributes Allowed Methods
//=================================================
//--------------------------------------------------------
/**
* Method : TestDevice::is_ScalarDynState_allowed()
* Description : Execution allowed for ScalarDyn attribute.
*/
//--------------------------------------------------------
bool TestDevice::is_ScalarDyn_allowed(Tango::AttReqType type)
{
// Not any excluded states for ScalarDyn attribute in READ access.
/*----- PROTECTED REGION ID(TestDevice::is_ScalarDyn_allowed) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // TestDevice::is_ScalarDyn_allowed
return true;
}
bool TestDevice::is_SpectrumDyn_allowed(Tango::AttReqType type)
{
// Not any excluded states for SpectrumDyn attribute in READ access.
/*----- PROTECTED REGION ID(TestDevice::is_SpectrumDyn_allowed) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // TestDevice::is_SpectrumDyn_allowed
return true;
}
bool TestDevice::is_Ref_allowed(Tango::AttReqType type)
{
// Not any excluded states for Ref attribute in READ access.
/*----- PROTECTED REGION ID(TestDevice::is_Ref_allowed) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // TestDevice::is_Ref_allowed
return true;
}
bool TestDevice::is_Values_allowed(Tango::AttReqType type)
{
// Not any excluded states for Values attribute in READ access.
/*----- PROTECTED REGION ID(TestDevice::is_Values_allowed) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // TestDevice::is_Values_allowed
return true;
}
/*----- PROTECTED REGION ID(TestDevice::are_dynamic_attributes_allowed) ENABLED START -----*/
// Add your code to check if dynamic attributes are alowed
/*----- PROTECTED REGION END -----*/ // TestDevice::are_dynamic_attributes_allowed
//=================================================
// Commands Allowed Methods
//=================================================
//--------------------------------------------------------
/**
* Method : TestDevice::is_WriteAttrname_allowed()
* Description : Execution allowed for WriteAttrname command.
*/
//--------------------------------------------------------
bool TestDevice::is_WriteAttrname_allowed(const CORBA::Any &any)
{
// Not any excluded states for WriteAttrname command.
/*----- PROTECTED REGION ID(XPI::is_WriteAttrname_allowed) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // XPI::is_WriteAttrname_allowed
return true;
}
//--------------------------------------------------------
/**
* Method : TestDevice::is_ReadAttrname_allowed()
* Description : Execution allowed for ReadAttrname command.
*/
//--------------------------------------------------------
bool TestDevice::is_ReadAttrname_allowed(const CORBA::Any &any)
{
// Not any excluded states for ReadAttrname command.
/*----- PROTECTED REGION ID(XPI::is_ReadAttrname_allowed) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // XPI::is_ReadAttrname_allowed
return true;
}
//--------------------------------------------------------
/**
* Method : TestDevice::is_Config_allowed()
* Description : Execution allowed for Config command.
*/
//--------------------------------------------------------
bool TestDevice::is_Config_allowed(const CORBA::Any &any)
{
// Not any excluded states for Config command.
/*----- PROTECTED REGION ID(XPI::is_Config_allowed) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // XPI::is_Config_allowed
return true;
}
//--------------------------------------------------------
/**
* Method : TestDevice::is_Add_allowed()
* Description : Execution allowed for Add command.
*/
//--------------------------------------------------------
bool TestDevice::is_Add_allowed(const CORBA::Any &any)
{
// Not any excluded states for Add command.
/*----- PROTECTED REGION ID(XPI::is_Add_allowed) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // XPI::is_Add_allowed
return true;
}
//--------------------------------------------------------
/**
* Method : TestDevice::is_AddDouble_allowed()
* Description : Execution allowed for AddDouble command.
*/
//--------------------------------------------------------
bool TestDevice::is_AddDouble_allowed(const CORBA::Any &any)
{
// Not any excluded states for AddDouble command.
/*----- PROTECTED REGION ID(XPI::is_AddDouble_allowed) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // XPI::is_AddDouble_allowed
return true;
}
//--------------------------------------------------------
/**
* Method : TestDevice::is_AddLong_allowed()
* Description : Execution allowed for AddLong command.
*/
//--------------------------------------------------------
bool TestDevice::is_AddLong_allowed(const CORBA::Any &any)
{
// Not any excluded states for AddLong command.
/*----- PROTECTED REGION ID(XPI::is_AddLong_allowed) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // XPI::is_AddLong_allowed
return true;
}
//--------------------------------------------------------
/**
* Method : TestDevice::is_AddBool_allowed()
* Description : Execution allowed for AddBool command.
*/
//--------------------------------------------------------
bool TestDevice::is_AddBool_allowed(const CORBA::Any &any)
{
// Not any excluded states for AddBool command.
/*----- PROTECTED REGION ID(XPI::is_AddBool_allowed) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // XPI::is_AddBool_allowed
return true;
}
//--------------------------------------------------------
/**
* Method : TestDevice::is_AddString_allowed()
* Description : Execution allowed for AddString command.
*/
//--------------------------------------------------------
bool TestDevice::is_AddString_allowed(const CORBA::Any &any)
{
// Not any excluded states for AddString command.
/*----- PROTECTED REGION ID(XPI::is_AddString_allowed) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // XPI::is_AddString_allowed
return true;
}
//--------------------------------------------------------
/**
* Method : TestDevice::is_Remove_allowed()
* Description : Execution allowed for Remove command.
*/
//--------------------------------------------------------
bool TestDevice::is_Remove_allowed(const CORBA::Any &any)
{
// Not any excluded states for Remove command.
/*----- PROTECTED REGION ID(XPI::is_Remove_allowed) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // XPI::is_Remove_allowed
return true;
}
/*----- PROTECTED REGION ID(TestDevice::are_dynamic_commands_allowed) ENABLED START -----*/
// Add your code to check if dynamic commands are alowed
/*----- PROTECTED REGION END -----*/ // TestDevice::are_dynamic_commands_allowed
} // namespace TestDevice_ns
/*PROTECTED REGION ID(TestDevice::main.cpp) ENABLED START*/
//=============================================================================
//
// file : TestDevice.cpp
//
// description : C++ source for the TestDevice device server main.
// The main rule is to initialise (and create) the Tango
// system and to create the DServerClass singleton.
// The main should be the same for every Tango device server.
//
// $Author: graziano $
//
//
//
//=============================================================================
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//=============================================================================
#include <tango.h>
int main(int argc,char *argv[])
{
Tango::Util *tg = NULL;
try
{
// Initialise the device server
//----------------------------------------
tg = Tango::Util::init(argc,argv);
// Create the device server singleton
// which will create everything
//----------------------------------------
tg->server_init(false);
// Run the endless loop
//----------------------------------------
cout << "Ready to accept request" << endl;
tg->server_run();
}
catch (bad_alloc)
{
cout << "Can't allocate memory to store device object !!!" << endl;
cout << "Exiting" << endl;
}
catch (CORBA::Exception &e)
{
Tango::Except::print_exception(e);
cout << "Received a CORBA_Exception" << endl;
cout << "Exiting" << endl;
}
if (tg!=NULL)
tg->server_cleanup();
return(0);
}
/*PROTECTED REGION END*/
//========================================================
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment