diff --git a/src/Vg.cpp b/src/Vg.cpp index 37da5c82c83eabf3eb55dcf5e02127662dd5d00a..f67fa51940ac62ce2890961f54dcd167e76ab6e1 100644 --- a/src/Vg.cpp +++ b/src/Vg.cpp @@ -55,12 +55,12 @@ namespace Vg_ns //-------------------------------------------------------- /** - * Method : Vg::Vg() - * Description : Constructors for a Tango device + * Method : Vg::Vg() + * Description: Constructors for a Tango device * implementing the classVg */ //-------------------------------------------------------- -Vg::Vg(Tango::DeviceClass *cl, string &s) +Vg::Vg(Tango::DeviceClass *cl, std::string &s) : TANGO_BASE_CLASS(cl, s.c_str()) { /*----- PROTECTED REGION ID(Vg::constructor_1) ENABLED START -----*/ @@ -89,16 +89,21 @@ Vg::Vg(Tango::DeviceClass *cl, const char *s, const char *d) /*----- PROTECTED REGION END -----*/ // Vg::constructor_3 } +//-------------------------------------------------------- +Vg::~Vg() +{ + delete_device(); +} //-------------------------------------------------------- /** - * Method : Vg::delete_device() - * Description : will be called at device destruction or at init command + * Method : Vg::delete_device() + * Description: will be called at device destruction or at init command */ //-------------------------------------------------------- void Vg::delete_device() { - DEBUG_STREAM << "Vg::delete_device() " << device_name << endl; + DEBUG_STREAM << "Vg::delete_device() " << device_name << std::endl; /*----- PROTECTED REGION ID(Vg::delete_device) ENABLED START -----*/ if(init_completed) @@ -125,13 +130,13 @@ void Vg::delete_device() //-------------------------------------------------------- /** - * Method : Vg::init_device() - * Description : will be called at device initialization. + * Method : Vg::init_device() + * Description: will be called at device initialization. */ //-------------------------------------------------------- void Vg::init_device() { - DEBUG_STREAM << "Vg::init_device() create device " << device_name << endl; + DEBUG_STREAM << "Vg::init_device() create device " << device_name << std::endl; /*----- PROTECTED REGION ID(Vg::init_device_before) ENABLED START -----*/ set_state(Tango::INIT); @@ -144,11 +149,11 @@ void Vg::init_device() last_exception_t = 0; /*----- PROTECTED REGION END -----*/ // Vg::init_device_before - + // Get the device properties from database get_device_property(); - + attr_Pressure_read = new Tango::DevDouble[1]; /*----- PROTECTED REGION ID(Vg::init_device) ENABLED START -----*/ @@ -174,8 +179,8 @@ void Vg::init_device() //-------------------------------------------------------- /** - * Method : Vg::get_device_property() - * Description : Read database to initialize property data members. + * Method : Vg::get_device_property() + * Description: Read database to initialize property data members. */ //-------------------------------------------------------- void Vg::get_device_property() @@ -202,7 +207,7 @@ void Vg::get_device_property() // Call database and extract values if (Tango::Util::instance()->_UseDb==true) get_db_device()->get_property(dev_prop); - + // get instance on VgClass to get class property Tango::DbDatum def_prop, cl_prop; VgClass *ds_class = @@ -336,13 +341,13 @@ void Vg::get_device_property() //-------------------------------------------------------- /** - * Method : Vg::always_executed_hook() - * Description : method always executed before any command is executed + * Method : Vg::always_executed_hook() + * Description: method always executed before any command is executed */ //-------------------------------------------------------- void Vg::always_executed_hook() { - DEBUG_STREAM << "Vg::always_executed_hook() " << device_name << endl; + DEBUG_STREAM << "Vg::always_executed_hook() " << device_name << std::endl; /*----- PROTECTED REGION ID(Vg::always_executed_hook) ENABLED START -----*/ if(update_allowed()) @@ -355,13 +360,13 @@ void Vg::always_executed_hook() //-------------------------------------------------------- /** - * Method : Vg::read_attr_hardware() - * Description : Hardware acquisition for attributes + * Method : Vg::read_attr_hardware() + * Description: Hardware acquisition for attributes */ //-------------------------------------------------------- -void Vg::read_attr_hardware(TANGO_UNUSED(vector<long> &attr_list)) +void Vg::read_attr_hardware(TANGO_UNUSED(std::vector<long> &attr_list)) { - DEBUG_STREAM << "Vg::read_attr_hardware(vector<long> &attr_list) entering... " << endl; + DEBUG_STREAM << "Vg::read_attr_hardware(std::vector<long> &attr_list) entering... " << std::endl; /*----- PROTECTED REGION ID(Vg::read_attr_hardware) ENABLED START -----*/ // Add your own code @@ -372,7 +377,7 @@ void Vg::read_attr_hardware(TANGO_UNUSED(vector<long> &attr_list)) //-------------------------------------------------------- /** * Read attribute Pressure related method - * Description: + * * * Data type: Tango::DevDouble * Attr type: Scalar @@ -380,7 +385,7 @@ void Vg::read_attr_hardware(TANGO_UNUSED(vector<long> &attr_list)) //-------------------------------------------------------- void Vg::read_Pressure(Tango::Attribute &attr) { - DEBUG_STREAM << "Vg::read_Pressure(Tango::Attribute &attr) entering... " << endl; + DEBUG_STREAM << "Vg::read_Pressure(Tango::Attribute &attr) entering... " << std::endl; /*----- PROTECTED REGION ID(Vg::read_Pressure) ENABLED START -----*/ try @@ -402,8 +407,8 @@ void Vg::read_Pressure(Tango::Attribute &attr) //-------------------------------------------------------- /** - * Method : Vg::add_dynamic_attributes() - * Description : Create the dynamic attributes if any + * Method : Vg::add_dynamic_attributes() + * Description: Create the dynamic attributes if any * for specified device. */ //-------------------------------------------------------- @@ -419,13 +424,13 @@ void Vg::add_dynamic_attributes() //-------------------------------------------------------- /** * Command On related method - * Description: + * * */ //-------------------------------------------------------- void Vg::on() { - DEBUG_STREAM << "Vg::On() - " << device_name << endl; + DEBUG_STREAM << "Vg::On() - " << device_name << std::endl; /*----- PROTECTED REGION ID(Vg::on) ENABLED START -----*/ try @@ -445,13 +450,13 @@ void Vg::on() //-------------------------------------------------------- /** * Command Off related method - * Description: + * * */ //-------------------------------------------------------- void Vg::off() { - DEBUG_STREAM << "Vg::Off() - " << device_name << endl; + DEBUG_STREAM << "Vg::Off() - " << device_name << std::endl; /*----- PROTECTED REGION ID(Vg::off) ENABLED START -----*/ try @@ -470,8 +475,8 @@ void Vg::off() } //-------------------------------------------------------- /** - * Method : Vg::add_dynamic_commands() - * Description : Create the dynamic commands if any + * Method : Vg::add_dynamic_commands() + * Description: Create the dynamic commands if any * for specified device. */ //-------------------------------------------------------- diff --git a/src/Vg.h b/src/Vg.h index 004980aaba7abdeb94afcc4dda93b1b7417060ca..bc67e46baa28801242fd5cd7021c245d03a26e6e 100644 --- a/src/Vg.h +++ b/src/Vg.h @@ -21,11 +21,22 @@ /*----- PROTECTED REGION END -----*/ // Vg.h +#ifdef TANGO_LOG + // cppTango after c934adea (Merge branch 'remove-cout-definition' into 'main', 2022-05-23) + // nothing to do +#else + // cppTango 9.3-backports and older + #define TANGO_LOG cout + #define TANGO_LOG_INFO cout2 + #define TANGO_LOG_DEBUG cout3 +#endif // TANGO_LOG + /** * Vg class description: * */ + namespace Vg_ns { /*----- PROTECTED REGION ID(Vg::Additional Class Declarations) ENABLED START -----*/ @@ -52,7 +63,7 @@ class Vg : public TANGO_BASE_CLASS // Device property data members public: // TpgDevice: - string tpgDevice; + std::string tpgDevice; // Channel: Tango::DevShort channel; // Timeout: @@ -76,7 +87,7 @@ public: * @param cl Class. * @param s Device Name */ - Vg(Tango::DeviceClass *cl,string &s); + Vg(Tango::DeviceClass *cl,std::string &s); /** * Constructs a newly device object. * @@ -95,7 +106,7 @@ public: /** * The device object destructor. */ - ~Vg() {delete_device();}; + ~Vg(); // Miscellaneous methods @@ -122,15 +133,15 @@ public: public: //-------------------------------------------------------- /* - * Method : Vg::read_attr_hardware() - * Description : Hardware acquisition for attributes. + * Method : Vg::read_attr_hardware() + * Description: Hardware acquisition for attributes. */ //-------------------------------------------------------- - virtual void read_attr_hardware(vector<long> &attr_list); + virtual void read_attr_hardware(std::vector<long> &attr_list); /** * Attribute Pressure related methods - * Description: + * * * Data type: Tango::DevDouble * Attr type: Scalar @@ -141,8 +152,8 @@ public: //-------------------------------------------------------- /** - * Method : Vg::add_dynamic_attributes() - * Description : Add dynamic attributes if any. + * Method : Vg::add_dynamic_attributes() + * Description: Add dynamic attributes if any. */ //-------------------------------------------------------- void add_dynamic_attributes(); @@ -154,14 +165,14 @@ public: public: /** * Command On related method - * Description: + * * */ virtual void on(); virtual bool is_On_allowed(const CORBA::Any &any); /** * Command Off related method - * Description: + * * */ virtual void off(); @@ -170,8 +181,8 @@ public: //-------------------------------------------------------- /** - * Method : Vg::add_dynamic_commands() - * Description : Add dynamic commands if any. + * Method : Vg::add_dynamic_commands() + * Description: Add dynamic commands if any. */ //-------------------------------------------------------- void add_dynamic_commands(); diff --git a/src/Vg.xmi b/src/Vg.xmi index cc78673b30fc11e247e1918fdfb8dbce8344cdd0..9630df7529d9a14fff4bab901e02c1af14497e0d 100644 --- a/src/Vg.xmi +++ b/src/Vg.xmi @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="ASCII"?> <pogoDsl:PogoSystem xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:pogoDsl="http://www.esrf.fr/tango/pogo/PogoDsl"> - <classes name="Vg" pogoRevision="9.6"> - <description description="" title="Vg" sourcePath="/home/graziano/ws/ds/vg/src" language="Cpp" filestogenerate="XMI file,Code files,Protected Regions" hasMandatoryProperty="false" hasConcreteProperty="true" hasAbstractCommand="false" hasAbstractAttribute="false"> + <classes name="Vg" pogoRevision="9.7"> + <description description="" title="Vg" sourcePath="/home/alessio/Sources/git-trees/vg/src" language="Cpp" filestogenerate="XMI file,Code files,Protected Regions" hasMandatoryProperty="false" hasConcreteProperty="true" hasAbstractCommand="false" hasAbstractAttribute="false"> <inheritances classname="Device_Impl" sourcePath=""/> <identification contact="at elettra.trieste.it - marco.demarco" author="marco.demarco" emailDomain="elettra.trieste.it" classFamily="Vacuum" siteSpecific="" platform="Unix Like" bus="TCP/UDP" manufacturer="none" reference=""/> </description> @@ -103,6 +103,6 @@ <states name="FAULT" description=""> <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> </states> - <preferences docHome="./doc_html" makefileHome="/usr/local/tango-9.3.3/share/pogo/preferences"/> + <preferences docHome="./doc_html" makefileHome="$(TANGO_HOME)"/> </classes> </pogoDsl:PogoSystem> diff --git a/src/VgClass.cpp b/src/VgClass.cpp index d1b7b365d31a056e1938d55c2d59421db2bd8050..ea4826af98247e2fef9ed42e75aa27b894c428e5 100644 --- a/src/VgClass.cpp +++ b/src/VgClass.cpp @@ -6,7 +6,7 @@ // description : C++ source for the VgClass. A singleton // class derived from DeviceClass. It implements the // command list and all properties and methods required -// by the «name» once per process. +// by the �name� once per process. // // project : Vg. // @@ -45,17 +45,20 @@ namespace Vg_ns //=================================================================== VgClass *VgClass::_instance = NULL; +//=================================================================== +// Class constants +//=================================================================== //-------------------------------------------------------- /** - * method : VgClass::VgClass(string &s) + * method : VgClass::VgClass(std::string &s) * description : constructor for the VgClass * * @param s The class name */ //-------------------------------------------------------- -VgClass::VgClass(string &s):Tango::DeviceClass(s) +VgClass::VgClass(std::string &s):Tango::DeviceClass(s) { - cout2 << "Entering VgClass constructor" << endl; + TANGO_LOG_INFO << "Entering VgClass constructor" << std::endl; set_default_property(); write_class_property(); @@ -63,7 +66,7 @@ VgClass::VgClass(string &s):Tango::DeviceClass(s) /*----- PROTECTED REGION END -----*/ // VgClass::constructor - cout2 << "Leaving VgClass constructor" << endl; + TANGO_LOG_INFO << "Leaving VgClass constructor" << std::endl; } //-------------------------------------------------------- @@ -97,10 +100,10 @@ VgClass *VgClass::init(const char *name) { try { - string s(name); + std::string s(name); _instance = new VgClass(s); } - catch (bad_alloc &) + catch (std::bad_alloc &) { throw; } @@ -119,7 +122,7 @@ VgClass *VgClass::instance() { if (_instance == NULL) { - cerr << "Class is not initialised !!" << endl; + std::cerr << "Class is not initialized !!" << std::endl; exit(-1); } return _instance; @@ -143,7 +146,7 @@ VgClass *VgClass::instance() //-------------------------------------------------------- CORBA::Any *OnClass::execute(Tango::DeviceImpl *device, TANGO_UNUSED(const CORBA::Any &in_any)) { - cout2 << "OnClass::execute(): arrived" << endl; + TANGO_LOG_INFO << "OnClass::execute(): arrived" << std::endl; ((static_cast<Vg *>(device))->on()); return new CORBA::Any(); } @@ -161,7 +164,7 @@ CORBA::Any *OnClass::execute(Tango::DeviceImpl *device, TANGO_UNUSED(const CORBA //-------------------------------------------------------- CORBA::Any *OffClass::execute(Tango::DeviceImpl *device, TANGO_UNUSED(const CORBA::Any &in_any)) { - cout2 << "OffClass::execute(): arrived" << endl; + TANGO_LOG_INFO << "OffClass::execute(): arrived" << std::endl; ((static_cast<Vg *>(device))->off()); return new CORBA::Any(); } @@ -172,11 +175,11 @@ CORBA::Any *OffClass::execute(Tango::DeviceImpl *device, TANGO_UNUSED(const CORB //=================================================================== //-------------------------------------------------------- /** - * Method : VgClass::get_class_property() - * Description : Get the class property for specified name. + * Method : VgClass::get_class_property() + * Description: Get the class property for specified name. */ //-------------------------------------------------------- -Tango::DbDatum VgClass::get_class_property(string &prop_name) +Tango::DbDatum VgClass::get_class_property(std::string &prop_name) { for (unsigned int i=0 ; i<cl_prop.size() ; i++) if (cl_prop[i].name == prop_name) @@ -187,11 +190,11 @@ Tango::DbDatum VgClass::get_class_property(string &prop_name) //-------------------------------------------------------- /** - * Method : VgClass::get_default_device_property() - * Description : Return the default value for device property. + * Method : VgClass::get_default_device_property() + * Description: Return the default value for device property. */ //-------------------------------------------------------- -Tango::DbDatum VgClass::get_default_device_property(string &prop_name) +Tango::DbDatum VgClass::get_default_device_property(std::string &prop_name) { for (unsigned int i=0 ; i<dev_def_prop.size() ; i++) if (dev_def_prop[i].name == prop_name) @@ -202,11 +205,11 @@ Tango::DbDatum VgClass::get_default_device_property(string &prop_name) //-------------------------------------------------------- /** - * Method : VgClass::get_default_class_property() - * Description : Return the default value for class property. + * Method : VgClass::get_default_class_property() + * Description: Return the default value for class property. */ //-------------------------------------------------------- -Tango::DbDatum VgClass::get_default_class_property(string &prop_name) +Tango::DbDatum VgClass::get_default_class_property(std::string &prop_name) { for (unsigned int i=0 ; i<cl_def_prop.size() ; i++) if (cl_def_prop[i].name == prop_name) @@ -218,8 +221,8 @@ Tango::DbDatum VgClass::get_default_class_property(string &prop_name) //-------------------------------------------------------- /** - * Method : VgClass::set_default_property() - * Description : Set default property (class and device) for wizard. + * Method : VgClass::set_default_property() + * Description: Set default property (class and device) for wizard. * For each property, add to wizard property name and description. * If default value has been set, add it to wizard property and * store it in a DbDatum. @@ -227,10 +230,10 @@ Tango::DbDatum VgClass::get_default_class_property(string &prop_name) //-------------------------------------------------------- void VgClass::set_default_property() { - string prop_name; - string prop_desc; - string prop_def; - vector<string> vect_data; + std::string prop_name; + std::string prop_desc; + std::string prop_def; + std::vector<std::string> vect_data; // Set Default Class Properties @@ -323,8 +326,8 @@ void VgClass::set_default_property() //-------------------------------------------------------- /** - * Method : VgClass::write_class_property() - * Description : Set class description fields as property in database + * Method : VgClass::write_class_property() + * Description: Set class description fields as property in database */ //-------------------------------------------------------- void VgClass::write_class_property() @@ -334,26 +337,25 @@ void VgClass::write_class_property() return; Tango::DbData data; - string classname = get_name(); - string header; - string::size_type start, end; + std::string classname = get_name(); + std::string header; // Put title Tango::DbDatum title("ProjectTitle"); - string str_title("Vg"); + std::string str_title("Vg"); title << str_title; data.push_back(title); // Put Description Tango::DbDatum description("Description"); - vector<string> str_desc; + std::vector<std::string> str_desc; str_desc.push_back(""); description << str_desc; data.push_back(description); // Put inheritance Tango::DbDatum inher_datum("InheritedFrom"); - vector<string> inheritance; + std::vector<std::string> inheritance; inheritance.push_back("TANGO_BASE_CLASS"); inher_datum << inheritance; data.push_back(inher_datum); @@ -368,8 +370,8 @@ void VgClass::write_class_property() //-------------------------------------------------------- /** - * Method : VgClass::device_factory() - * Description : Create the device object(s) + * Method : VgClass::device_factory() + * Description: Create the device object(s) * and store them in the device list */ //-------------------------------------------------------- @@ -384,7 +386,7 @@ void VgClass::device_factory(const Tango::DevVarStringArray *devlist_ptr) // Create devices and add it into the device list for (unsigned long i=0 ; i<devlist_ptr->length() ; i++) { - cout4 << "Device name : " << (*devlist_ptr)[i].in() << endl; + TANGO_LOG_DEBUG << "Device name : " << (*devlist_ptr)[i].in() << std::endl; device_list.push_back(new Vg(this, (*devlist_ptr)[i])); } @@ -413,12 +415,12 @@ void VgClass::device_factory(const Tango::DevVarStringArray *devlist_ptr) } //-------------------------------------------------------- /** - * Method : VgClass::attribute_factory() - * Description : Create the attribute object(s) + * Method : VgClass::attribute_factory() + * Description: Create the attribute object(s) * and store them in the attribute list */ //-------------------------------------------------------- -void VgClass::attribute_factory(vector<Tango::Attr *> &att_list) +void VgClass::attribute_factory(std::vector<Tango::Attr *> &att_list) { /*----- PROTECTED REGION ID(VgClass::attribute_factory_before) ENABLED START -----*/ @@ -442,7 +444,6 @@ void VgClass::attribute_factory(vector<Tango::Attr *> &att_list) // min_warning not set for Pressure // delta_t not set for Pressure // delta_val not set for Pressure - pressure->set_default_properties(pressure_prop); // Not Polled pressure->set_disp_level(Tango::OPERATOR); @@ -460,8 +461,8 @@ void VgClass::attribute_factory(vector<Tango::Attr *> &att_list) } //-------------------------------------------------------- /** - * Method : VgClass::pipe_factory() - * Description : Create the pipe object(s) + * Method : VgClass::pipe_factory() + * Description: Create the pipe object(s) * and store them in the pipe list */ //-------------------------------------------------------- @@ -480,8 +481,8 @@ void VgClass::pipe_factory() } //-------------------------------------------------------- /** - * Method : VgClass::command_factory() - * Description : Create the command object(s) + * Method : VgClass::command_factory() + * Description: Create the command object(s) * and store them in the command list */ //-------------------------------------------------------- @@ -524,19 +525,19 @@ void VgClass::command_factory() * method : VgClass::create_static_attribute_list * description : Create the a list of static attributes * - * @param att_list the ceated attribute list + * @param att_list the created attribute list */ //-------------------------------------------------------- -void VgClass::create_static_attribute_list(vector<Tango::Attr *> &att_list) +void VgClass::create_static_attribute_list(std::vector<Tango::Attr *> &att_list) { for (unsigned long i=0 ; i<att_list.size() ; i++) { - string att_name(att_list[i]->get_name()); + std::string att_name(att_list[i]->get_name()); transform(att_name.begin(), att_name.end(), att_name.begin(), ::tolower); defaultAttList.push_back(att_name); } - cout2 << defaultAttList.size() << " attributes in default list" << endl; + TANGO_LOG_INFO << defaultAttList.size() << " attributes in default list" << std::endl; /*----- PROTECTED REGION ID(VgClass::create_static_att_list) ENABLED START -----*/ @@ -553,26 +554,26 @@ void VgClass::create_static_attribute_list(vector<Tango::Attr *> &att_list) * @param list of all attributes */ //-------------------------------------------------------- -void VgClass::erase_dynamic_attributes(const Tango::DevVarStringArray *devlist_ptr, vector<Tango::Attr *> &att_list) +void VgClass::erase_dynamic_attributes(const Tango::DevVarStringArray *devlist_ptr, std::vector<Tango::Attr *> &att_list) { Tango::Util *tg = Tango::Util::instance(); for (unsigned long i=0 ; i<devlist_ptr->length() ; i++) { - Tango::DeviceImpl *dev_impl = tg->get_device_by_name(((string)(*devlist_ptr)[i]).c_str()); + Tango::DeviceImpl *dev_impl = tg->get_device_by_name(((std::string)(*devlist_ptr)[i]).c_str()); Vg *dev = static_cast<Vg *> (dev_impl); - vector<Tango::Attribute *> &dev_att_list = dev->get_device_attr()->get_attribute_list(); - vector<Tango::Attribute *>::iterator ite_att; + std::vector<Tango::Attribute *> &dev_att_list = dev->get_device_attr()->get_attribute_list(); + std::vector<Tango::Attribute *>::iterator ite_att; for (ite_att=dev_att_list.begin() ; ite_att != dev_att_list.end() ; ++ite_att) { - string att_name((*ite_att)->get_name_lower()); + std::string att_name((*ite_att)->get_name_lower()); if ((att_name == "state") || (att_name == "status")) continue; - vector<string>::iterator ite_str = find(defaultAttList.begin(), defaultAttList.end(), att_name); + std::vector<std::string>::iterator ite_str = find(defaultAttList.begin(), defaultAttList.end(), att_name); if (ite_str == defaultAttList.end()) { - cout2 << att_name << " is a UNWANTED dynamic attribute for device " << (*devlist_ptr)[i] << endl; + TANGO_LOG_INFO << att_name << " is a UNWANTED dynamic attribute for device " << (*devlist_ptr)[i] << std::endl; Tango::Attribute &att = dev->get_device_attr()->get_attr_by_name(att_name.c_str()); dev->remove_attribute(att_list[att.get_attr_idx()], true, false); --ite_att; @@ -586,13 +587,13 @@ void VgClass::erase_dynamic_attributes(const Tango::DevVarStringArray *devlist_p //-------------------------------------------------------- /** - * Method : VgClass::get_attr_object_by_name() - * Description : returns Tango::Attr * object found by name + * Method : VgClass::get_attr_object_by_name() + * Description: returns Tango::Attr * object found by name */ //-------------------------------------------------------- -Tango::Attr *VgClass::get_attr_object_by_name(vector<Tango::Attr *> &att_list, string attname) +Tango::Attr *VgClass::get_attr_object_by_name(std::vector<Tango::Attr *> &att_list, std::string attname) { - vector<Tango::Attr *>::iterator it; + std::vector<Tango::Attr *>::iterator it; for (it=att_list.begin() ; it<att_list.end() ; ++it) if ((*it)->get_name()==attname) return (*it); diff --git a/src/VgClass.h b/src/VgClass.h index 034d4331a3a7e1576c234aee4c7e757ee129b03c..5cb6b2ce869ff0a074dc655e19e8ec7b7aa4707d 100644 --- a/src/VgClass.h +++ b/src/VgClass.h @@ -40,8 +40,8 @@ class PressureAttrib: public Tango::Attr { public: PressureAttrib():Attr("Pressure", - Tango::DEV_DOUBLE, Tango::READ) {}; - ~PressureAttrib() {}; + Tango::DEV_DOUBLE, Tango::READ) {} + ~PressureAttrib() {} virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) {(static_cast<Vg *>(dev))->read_Pressure(att);} virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) @@ -56,20 +56,20 @@ public: class OnClass : public Tango::Command { public: - OnClass(const char *name, + OnClass(const char *cmd_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) {}; + :Command(cmd_name,in,out,in_desc,out_desc, level) {} - OnClass(const char *name, + OnClass(const char *cmd_name, Tango::CmdArgType in, Tango::CmdArgType out) - :Command(name,in,out) {}; - ~OnClass() {}; - + :Command(cmd_name,in,out) {} + ~OnClass() {} + 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<Vg *>(dev))->is_On_allowed(any);} @@ -79,20 +79,20 @@ public: class OffClass : public Tango::Command { public: - OffClass(const char *name, + OffClass(const char *cmd_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) {}; + :Command(cmd_name,in,out,in_desc,out_desc, level) {} - OffClass(const char *name, + OffClass(const char *cmd_name, Tango::CmdArgType in, Tango::CmdArgType out) - :Command(name,in,out) {}; - ~OffClass() {}; - + :Command(cmd_name,in,out) {} + ~OffClass() {} + 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<Vg *>(dev))->is_Off_allowed(any);} @@ -109,42 +109,41 @@ class __declspec(dllexport) VgClass : public Tango::DeviceClass class VgClass : public Tango::DeviceClass #endif { - /*----- PROTECTED REGION ID(VgClass::Additionnal DServer data members) ENABLED START -----*/ + /*----- PROTECTED REGION ID(VgClass::Additional DServer data members) ENABLED START -----*/ - /*----- PROTECTED REGION END -----*/ // VgClass::Additionnal DServer data members + /*----- PROTECTED REGION END -----*/ // VgClass::Additional 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 VgClass *init(const char *); static VgClass *instance(); ~VgClass(); - Tango::DbDatum get_class_property(string &); - Tango::DbDatum get_default_device_property(string &); - Tango::DbDatum get_default_class_property(string &); - + Tango::DbDatum get_class_property(std::string &); + Tango::DbDatum get_default_device_property(std::string &); + Tango::DbDatum get_default_class_property(std::string &); + protected: - VgClass(string &); + VgClass(std::string &); static VgClass *_instance; void command_factory(); - void attribute_factory(vector<Tango::Attr *> &); + void attribute_factory(std::vector<Tango::Attr *> &); void pipe_factory(); void write_class_property(); void set_default_property(); void get_class_property(); - string get_cvstag(); - string get_cvsroot(); - + std::string get_cvstag(); + std::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; - Tango::Attr *get_attr_object_by_name(vector<Tango::Attr *> &att_list, string attname); + void device_factory(TANGO_UNUSED(const Tango::DevVarStringArray *)); + void create_static_attribute_list(std::vector<Tango::Attr *> &); + void erase_dynamic_attributes(const Tango::DevVarStringArray *,std::vector<Tango::Attr *> &); + std::vector<std::string> defaultAttList; + Tango::Attr *get_attr_object_by_name(std::vector<Tango::Attr *> &att_list, std::string attname); }; } // End of namespace diff --git a/src/VgStateMachine.cpp b/src/VgStateMachine.cpp index 90bbf6ad8a10f33912cb05ee05e3cec0ad9fd587..3dbfd304a13e22c048d0222d387fcb62c5da3600 100644 --- a/src/VgStateMachine.cpp +++ b/src/VgStateMachine.cpp @@ -3,7 +3,7 @@ // // file : VgStateMachine.cpp // -// description : C++ source for the «name» and its alowed +// description : C++ source for the �name� and its alowed // methods for commands and attributes // // project : Vg. @@ -38,8 +38,8 @@ namespace Vg_ns //-------------------------------------------------------- /** - * Method : Vg::is_Pressure_allowed() - * Description : Execution allowed for Pressure attribute + * Method : Vg::is_Pressure_allowed() + * Description: Execution allowed for Pressure attribute */ //-------------------------------------------------------- bool Vg::is_Pressure_allowed(TANGO_UNUSED(Tango::AttReqType type)) @@ -48,7 +48,7 @@ bool Vg::is_Pressure_allowed(TANGO_UNUSED(Tango::AttReqType type)) // Check access type. if ( type==Tango::READ_REQ ) { - // Compare device state with not allowed states for READ + // Compare device state with not allowed states for READ if (get_state()==Tango::OFF || get_state()==Tango::DISABLE || get_state()==Tango::FAULT) @@ -70,8 +70,8 @@ bool Vg::is_Pressure_allowed(TANGO_UNUSED(Tango::AttReqType type)) //-------------------------------------------------------- /** - * Method : Vg::is_On_allowed() - * Description : Execution allowed for On attribute + * Method : Vg::is_On_allowed() + * Description: Execution allowed for On attribute */ //-------------------------------------------------------- bool Vg::is_On_allowed(TANGO_UNUSED(const CORBA::Any &any)) @@ -91,8 +91,8 @@ bool Vg::is_On_allowed(TANGO_UNUSED(const CORBA::Any &any)) //-------------------------------------------------------- /** - * Method : Vg::is_Off_allowed() - * Description : Execution allowed for Off attribute + * Method : Vg::is_Off_allowed() + * Description: Execution allowed for Off attribute */ //-------------------------------------------------------- bool Vg::is_Off_allowed(TANGO_UNUSED(const CORBA::Any &any))