[pytango] 277/483: a test of sip
Sandor Bodo-Merle
sbodomerle-guest at moszumanska.debian.org
Thu Sep 28 19:14:50 UTC 2017
This is an automated email from the git hooks/post-receive script.
sbodomerle-guest pushed a commit to annotated tag bliss_8.10
in repository pytango.
commit 92345589e0f3852b164c85e41e9d3206b6424992
Author: tiagocoutinho <tiagocoutinho at 4e9c00fd-8f2e-0410-aa12-93ce3db5e235>
Date: Fri Sep 13 18:28:50 2013 +0000
a test of sip
git-svn-id: http://svn.code.sf.net/p/tango-cs/code/bindings/PyTango/trunk@23648 4e9c00fd-8f2e-0410-aa12-93ce3db5e235
---
src/sip/command_info.sip | 131 -----------------------
src/sip/configure.py | 28 ++++-
src/sip/constants.sip | 2 -
src/sip/database.sip | 193 ----------------------------------
src/sip/db_datum.sip | 123 ----------------------
src/sip/db_dev_import_info.sip | 37 -------
src/sip/db_dev_info.sip | 36 -------
src/sip/device_proxy.sip | 232 -----------------------------------------
src/sip/std_utils.sip | 76 ++------------
src/sip/tango.sip | 38 -------
10 files changed, 34 insertions(+), 862 deletions(-)
diff --git a/src/sip/command_info.sip b/src/sip/command_info.sip
deleted file mode 100644
index 2fc3fca..0000000
--- a/src/sip/command_info.sip
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
-
- This file is part of PyTango, a python binding for Tango
-
- http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html
-
- Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
-
- PyTango is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- PyTango is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with PyTango. If not, see <http://www.gnu.org/licenses/>.
-
-*******************************************************************************/
-
-struct DevCommandInfo
-{
-%TypeHeaderCode
-#include <tango.h>
-using namespace Tango;
-%End
-
- std::string cmd_name;
- long cmd_tag;
- long in_type;
- long out_type;
- std::string in_type_desc;
- std::string out_type_desc;
-
- bool operator==(const DevCommandInfo &);
-};
-
-struct CommandInfo : DevCommandInfo
-{
-%TypeHeaderCode
-#include <tango.h>
-using namespace Tango;
-%End
-
- DispLevel disp_level;
-
- bool operator==(const CommandInfo &);
-};
-
-/*
-%MappedType CommandInfoList
-{
-%TypeHeaderCode
-#include <vector>
-#include <tango.h>
-using namespace Tango;
-%End
-
-%ConvertToTypeCode
- // See if we are just being asked to check the type of the Python
- // object.
- if(sipIsErr == NULL)
- {
- bool aReturnFlag = PyList_Check(sipPy);
- for(int i = 0; aReturnFlag && i < PySequence_Size(sipPy); ++i)
- {
- aReturnFlag = sipCanConvertToType(PySequence_ITEM(sipPy, i),
- sipType_CommandInfo,
- SIP_NOT_NONE);
- }
- return aReturnFlag;
- }
-
- CommandInfoList *cmdInfoList = new CommandInfoList();
- for(int i = 0; i < PySequence_Size(sipPy); ++i)
- {
- int state;
- CommandInfo *aCommandInfo = reinterpret_cast<CommandInfo*>(
- sipConvertToType(PySequence_ITEM(sipPy, i),
- sipType_CommandInfo, Py_None,
- SIP_NOT_NONE,
- &state, sipIsErr));
- // Deal with any errors.
- if (*sipIsErr)
- {
- sipReleaseType(aCommandInfo, sipType_CommandInfo, state);
-
- // Tidy up.
- delete cmdInfoList;
-
- // There is no temporary instance.
- return 0;
- }
- cmdInfoList->push_back(*aCommandInfo);
- sipReleaseType(aCommandInfo, sipType_CommandInfo, state);
- }
- *sipCppPtr = cmdInfoList;
- return sipGetState(sipTransferObj);
-%End
-
-%ConvertFromTypeCode
- PyObject *l;
-
- // Create the Python list of the correct length.
- if (!(l = PyList_New(sipCpp->size())))
- return NULL;
-
- // Go through each element in the C++ instance and convert it to a
- // wrapped CommandInfo
- int i = 0;
- for(std::vector<CommandInfo>::iterator j = sipCpp->begin();
- j != sipCpp->end(); ++j, ++i)
- {
- CommandInfo &aCommandInfo = *j;
- PyObject *wobj;
-
- if (!(wobj = sipConvertFromNewType(&aCommandInfo, sipType_CommandInfo, sipTransferObj)))
- {
- // There was an error so garbage collect the Python list.
- Py_DECREF(l);
- return NULL;
- }
- PyList_SET_ITEM(l, i, wobj);
- }
- return l;
-%End
-};
-*/
diff --git a/src/sip/configure.py b/src/sip/configure.py
index f73db57..ea03e84 100644
--- a/src/sip/configure.py
+++ b/src/sip/configure.py
@@ -4,16 +4,37 @@ import sipconfig
# The name of the SIP build file generated by SIP and used by the build
# system.
-build_file = "tango.sbf"
+
+this_dir = os.path.dirname(os.path.abspath(__file__))
+out_dir = os.path.join(this_dir, 'out')
+
+name = "Tango"
+sip_file = os.path.join(this_dir, name + ".sip")
+build_file = os.path.join(out_dir , name + ".sbf")
# Get the SIP configuration information.
config = sipconfig.Configuration()
+
# Run SIP to generate the code.
-os.system(" ".join([config.sip_bin, "-c", ".", "-b", build_file, "tango.sip"]))
+cmd = " ".join([config.sip_bin,
+ "-e" , # Enable support for exceptions.
+ "-g", # Always release and reaquire the GIL.
+ "-w", # Enable warning messages
+ "-c", out_dir,
+ "-b", build_file,
+ sip_file])
+print cmd
+ret = os.system(cmd)
+
+if ret:
+ print "sip error: exiting..."
+ sys.exit(ret)
# Create the Makefile.
-makefile = sipconfig.SIPModuleMakefile(config, build_file)
+makefile = sipconfig.SIPModuleMakefile(config, build_file,
+ dir=out_dir,
+ install_dir=this_dir)
python_lib = "python{v[0]}.{v[1]}".format(v=sys.version_info)
@@ -32,3 +53,4 @@ makefile.extra_lflags = ['-z defs']
# Generate the Makefile itself.
makefile.generate()
+
diff --git a/src/sip/constants.sip b/src/sip/constants.sip
index 9a513aa..e98aa04 100644
--- a/src/sip/constants.sip
+++ b/src/sip/constants.sip
@@ -102,8 +102,6 @@ enum LockCmdCode {
LOCK_EXIT
};
-
-
enum LogLevel {
LOG_OFF,
LOG_FATAL,
diff --git a/src/sip/database.sip b/src/sip/database.sip
deleted file mode 100644
index 205ea81..0000000
--- a/src/sip/database.sip
+++ /dev/null
@@ -1,193 +0,0 @@
-/*******************************************************************************
-
- This file is part of PyTango, a python binding for Tango
-
- http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html
-
- Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
-
- PyTango is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- PyTango is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with PyTango. If not, see <http://www.gnu.org/licenses/>.
-
-*******************************************************************************/
-
-class Database : Connection {
-
-%TypeHeaderCode
-#include <tango.h>
-using namespace Tango;
-%End
-
-private:
- virtual std::string get_corba_name(bool);
- virtual std::string build_corba_name();
- virtual int get_lock_ctr();
- virtual void set_lock_ctr(int);
- virtual std::string dev_name();
-
-public :
- Database();
- Database(std::string &host, int port);
- Database(std::string &file);
-
- Database(const Database &);
-//// Database & operator=(const Database &);
-
- void write_filedatabase();
- void reread_filedatabase();
- void write_event_channel_ior_filedatabase(std::string &);
- void build_connection ();
- void post_reconnection();
-
-
-//// inline Device_var &get_dbase() { return device;}
- void check_tango_host(const char *);
- AccessControlType check_access_control(std::string &);
- bool is_control_access_checked();
- void set_access_checked(bool val);
-
-// void set_tango_utils(Tango::Util *ptr);
- int get_server_release();
-
-// DevErrorList &get_access_except_errors();
- void clear_access_except_errors();
- bool is_command_allowed(std::string &,std::string &);
-
- bool is_multi_tango_host();
- std::vector<std::string> &get_multi_host();
- std::vector<std::string> &get_multi_port();
-
- const std::string &get_file_name();
-
-//#ifdef _TG_WINDOWS_
-// Database(CORBA::ORB *orb,std::string &,std::string &);
-// long get_tango_host_from_reg(char **,std::string &,std::string &);
-//#endif
-
-//
-// general methods
-//
-
- std::string get_info();
-
- DbDatum get_host_list();
- DbDatum get_host_list(std::string &);
- DbDatum get_services(std::string &,std::string &);
- void register_service(std::string &,std::string &,std::string &);
- void unregister_service(std::string &,std::string &);
-// CORBA::Any *fill_server_cache(std::string &,std::string &);
-
-/*
-//
-// device methods
-//
-
- void add_device(DbDevInfo&);
- void delete_device(std::string);
- DbDevImportInfo import_device(std::string &);
- void export_device(DbDevExportInfo &);
- void unexport_device(std::string);
-
- DbDatum get_device_name(std::string &, std::string &,DbServerCache *dsc);
- DbDatum get_device_name(std::string &, std::string &);
- DbDatum get_device_exported(std::string &);
- DbDatum get_device_domain(std::string &);
- DbDatum get_device_family(std::string &);
- DbDatum get_device_member(std::string &);
- void get_device_alias(std::string,std::string &);
- void get_alias(std::string,std::string &);
- DbDatum get_device_alias_list(std::string &);
- std::string get_class_for_device(std::string &);
- DbDatum get_class_inheritance_for_device(std::string &);
- DbDatum get_device_exported_for_class(std::string &);
- void put_device_alias(std::string &,std::string &);
- void delete_device_alias(std::string &);
-
-//
-// server methods
-//
- void add_server(std::string &, DbDevInfos&);
- void delete_server(std::string &);
- void export_server(DbDevExportInfos &);
- void unexport_server(std::string &);
-
- DbServerInfo get_server_info(std::string &);
- void put_server_info(DbServerInfo &);
- void delete_server_info(std::string &);
- DbDatum get_server_class_list(std::string &);
- DbDatum get_server_name_list();
- DbDatum get_instance_name_list(std::string &);
- DbDatum get_server_list();
- DbDatum get_server_list(std::string &);
- DbDatum get_host_server_list(std::string &);
- DbDatum get_device_class_list(std::string &);
-
-//
-// property methods
-//
-
- void get_property(std::string, DbData &,DbServerCache *dsc);
- void get_property(std::string st, DbData &db) {get_property(st,db,NULL);}
- void get_property_forced(std::string, DbData &,DbServerCache *dsc = NULL);
- void put_property(std::string, DbData &);
- void delete_property(std::string, DbData &);
- vector<DbHistory> get_property_history(std::string &,std::string &);
- DbDatum get_object_list(std::string &);
- DbDatum get_object_property_list(std::string &,std::string &);
-
- void get_device_property(std::string, DbData &, DbServerCache *dsc);
- void get_device_property(std::string st, DbData &db) {get_device_property(st,db,NULL);}
- void put_device_property(std::string, DbData &);
- void delete_device_property(std::string, DbData &);
- vector<DbHistory> get_device_property_history(std::string &,std::string &);
- DbDatum get_device_property_list(std::string &,std::string &);
- void get_device_property_list(std::string &,const std::string &,vector<std::string> &,DbServerCache *dsc = NULL);
-
- void get_device_attribute_property(std::string, DbData &, DbServerCache *dsc);
- void get_device_attribute_property(std::string st, DbData &db) {get_device_attribute_property(st,db,NULL);}
- void put_device_attribute_property(std::string, DbData &);
- void delete_device_attribute_property(std::string, DbData &);
- void delete_all_device_attribute_property(std::string, DbData &);
- vector<DbHistory> get_device_attribute_property_history(std::string &,std::string &,std::string &);
-
- void get_class_property(std::string, DbData &, DbServerCache *dsc);
- void get_class_property(std::string st,DbData &db) {get_class_property(st,db,NULL);}
- void put_class_property(std::string, DbData &);
- void delete_class_property(std::string, DbData &);
- vector<DbHistory> get_class_property_history(std::string &,std::string &);
- DbDatum get_class_list(std::string &);
- DbDatum get_class_property_list(std::string &);
-
- void get_class_attribute_property(std::string, DbData &, DbServerCache *dsc);
- void get_class_attribute_property(std::string st,DbData &db) {get_class_attribute_property(st,db,NULL);}
- void put_class_attribute_property(std::string, DbData &);
- void delete_class_attribute_property(std::string, DbData &);
- vector<DbHistory> get_class_attribute_property_history(std::string &,std::string &,std::string &);
- DbDatum get_class_attribute_list(std::string &,std::string &);
-
-
-// attribute methods
-
- void get_attribute_alias(std::string, std::string&);
- DbDatum get_attribute_alias_list(std::string &);
- void put_attribute_alias(std::string &,std::string &);
- void delete_attribute_alias(std::string &);
-
-// event methods
-
- void export_event(DevVarstd::stringArray *);
- void unexport_event(std::string &);
- CORBA::Any *import_event(std::string &);
-*/
-};
-
diff --git a/src/sip/db_datum.sip b/src/sip/db_datum.sip
deleted file mode 100644
index 0bea30f..0000000
--- a/src/sip/db_datum.sip
+++ /dev/null
@@ -1,123 +0,0 @@
-/*******************************************************************************
-
- This file is part of PyTango, a python binding for Tango
-
- http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html
-
- Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
-
- PyTango is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- PyTango is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with PyTango. If not, see <http://www.gnu.org/licenses/>.
-
-*******************************************************************************/
-
-//
-// DbDatum - data object for sending and receiving data from the
-// TANGO database api
-//
-class DbDatum
-{
-
-%TypeHeaderCode
-#include <tango.h>
-using namespace Tango;
-%End
-
-public :
- enum except_flags
- {
- isempty_flag,
- wrongtype_flag,
- numFlags
- };
-
- std::string name;
- std::vector<std::string> value_string;
-
-//
-// constructor methods
-//
- DbDatum();
- DbDatum (std::string);
- DbDatum (const char *);
- ~DbDatum();
- DbDatum(const DbDatum &);
-// DbDatum &operator=(const DbDatum &);
-
-// size_t size();
- bool is_empty();
-
-//// void exceptions(bitset<numFlags> fl) { exceptions_flags = fl;}
-//// bitset<numFlags> exceptions() {return exceptions_flags;}
- void reset_exceptions(except_flags fl);
- void set_exceptions(except_flags fl);
-
-//
-// insert methods
-//
-/*
- void operator << (bool);
- void operator << (short);
- void operator << (unsigned char);
- void operator << (unsigned short);
- void operator << (DevLong);
- void operator << (DevULong);
- void operator << (DevLong64);
- void operator << (DevULong64);
- void operator << (float);
- void operator << (double);
- void operator << (char *);
-// void operator << (char *&);
- void operator << (const char *);
-// void operator << (const char *&);
- void operator << (std::string&);
-
- void operator << (vector<std::string>&);
- void operator << (vector<short>&);
- void operator << (vector<unsigned short>&);
- void operator << (vector<DevLong>&);
- void operator << (vector<DevULong>&);
- void operator << (vector<DevLong64>&);
- void operator << (vector<DevULong64>&);
- void operator << (vector<float>&);
- void operator << (vector<double>&);
-
-//
-// extract methods
-//
-
- bool operator >> (bool&);
- bool operator >> (short&);
- bool operator >> (unsigned char&);
- bool operator >> (unsigned short&);
- bool operator >> (DevLong&);
- bool operator >> (DevULong&);
- bool operator >> (DevLong64&);
- bool operator >> (DevULong64&);
- bool operator >> (float&);
- bool operator >> (double&);
- bool operator >> (const char*&);
- bool operator >> (std::string&);
-
- bool operator >> (vector<std::string>&);
- bool operator >> (vector<short>&);
- bool operator >> (vector<unsigned short>&);
- bool operator >> (vector<DevLong>&);
- bool operator >> (vector<DevULong>&);
- bool operator >> (vector<DevLong64>&);
- bool operator >> (vector<DevULong64>&);
- bool operator >> (vector<float>&);
- bool operator >> (vector<double>&);
-*/
-};
-
diff --git a/src/sip/db_dev_import_info.sip b/src/sip/db_dev_import_info.sip
deleted file mode 100644
index 805b51d..0000000
--- a/src/sip/db_dev_import_info.sip
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
-
- This file is part of PyTango, a python binding for Tango
-
- http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html
-
- Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
-
- PyTango is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- PyTango is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with PyTango. If not, see <http://www.gnu.org/licenses/>.
-
-*******************************************************************************/
-
-class DbDevImportInfo
-{
-
-%TypeHeaderCode
-#include <tango.h>
-using namespace Tango;
-%End
-
-public :
- std::string name;
- long exported;
- std::string ior;
- std::string version;
-};
\ No newline at end of file
diff --git a/src/sip/db_dev_info.sip b/src/sip/db_dev_info.sip
deleted file mode 100644
index ab186ad..0000000
--- a/src/sip/db_dev_info.sip
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
-
- This file is part of PyTango, a python binding for Tango
-
- http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html
-
- Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
-
- PyTango is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- PyTango is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with PyTango. If not, see <http://www.gnu.org/licenses/>.
-
-*******************************************************************************/
-
-class DbDevInfo
-{
-
-%TypeHeaderCode
-#include <tango.h>
-using namespace Tango;
-%End
-
-public :
- std::string name;
- std::string _class;
- std::string server;
-};
\ No newline at end of file
diff --git a/src/sip/device_proxy.sip b/src/sip/device_proxy.sip
deleted file mode 100644
index f945125..0000000
--- a/src/sip/device_proxy.sip
+++ /dev/null
@@ -1,232 +0,0 @@
-/*******************************************************************************
-
- This file is part of PyTango, a python binding for Tango
-
- http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html
-
- Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
-
- PyTango is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- PyTango is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with PyTango. If not, see <http://www.gnu.org/licenses/>.
-
-*******************************************************************************/
-
-class DeviceProxy : Connection {
-
-%TypeHeaderCode
-#include <tango.h>
-using namespace Tango;
-%End
-
-protected:
- virtual std::string get_corba_name(bool);
- virtual std::string build_corba_name();
- virtual int get_lock_ctr();
- virtual void set_lock_ctr(int);
-
-public:
- DeviceProxy();
- DeviceProxy(const char *, bool ch_access);
- DeviceProxy(const char *);
-
- DeviceProxy(const DeviceProxy &);
-// DeviceProxy & operator=(const DeviceProxy &);
-
-//
-// general methods
-//
-
-// virtual DeviceInfo const &info();
- virtual std::string dev_name();
- virtual void parse_name(std::string &);
- virtual Database *get_device_db();
-
- virtual std::string status();
- virtual DevState state();
- virtual std::string adm_name();
- virtual std::string description();
- virtual std::string name();
- virtual std::string alias();
-
- virtual int ping();
-
- virtual std::vector<std::string> * black_box(int);
-
-//
-// device methods
-//
- virtual CommandInfo command_query(std::string);
- virtual std::vector<CommandInfoList*> *command_list_query();
-
-
-/*
- virtual DbDevImportInfo import_info();
-//
-// property methods
-//
- virtual void get_property(std::string&, DbData&);
- virtual void get_property(vector<std::string>&, DbData&);
- virtual void get_property(DbData&);
- virtual void put_property(DbData&);
- virtual void delete_property(std::string&);
- virtual void delete_property(vector<std::string>&);
- virtual void delete_property(DbData&);
- virtual void get_property_list(const std::string &,vector<std::string> &);
-//
-// attribute methods
-//
- virtual std::vector<std::string> *get_attribute_list();
-
- virtual AttributeInfoList *get_attribute_config(vector<std::string>&);
- virtual AttributeInfoListEx *get_attribute_config_ex(vector<std::string>&);
- virtual AttributeInfoEx get_attribute_config(const std::string &);
-
- virtual AttributeInfoEx attribute_query(std::string name) {return get_attribute_config(name);}
- virtual AttributeInfoList *attribute_list_query();
- virtual AttributeInfoListEx *attribute_list_query_ex();
-
- virtual void set_attribute_config(AttributeInfoList &);
- virtual void set_attribute_config(AttributeInfoListEx &);
-
- virtual DeviceAttribute read_attribute(std::string&);
- virtual DeviceAttribute read_attribute(const char *at) {std::string str(at);return read_attribute(str);}
- void read_attribute(const char *,DeviceAttribute &);
- void read_attribute(std::string &at,DeviceAttribute &da) {read_attribute(at.c_str(),da);}
- virtual std::vector<DeviceAttribute> *read_attributes(vector<std::string>&);
-
- virtual void write_attribute(DeviceAttribute&);
- virtual void write_attributes(vector<DeviceAttribute>&);
-
- virtual DeviceAttribute write_read_attribute(DeviceAttribute &);
-
-//
-// history methods
-//
- virtual std::vector<DeviceDataHistory> *command_history(std::string &,int);
- virtual std::vector<DeviceDataHistory> *command_history(const char *na,int n)
- {std::string str(na);return command_history(str,n);}
-
- virtual std::vector<DeviceAttributeHistory> *attribute_history(std::string &,int);
- virtual std::vector<DeviceAttributeHistory> *attribute_history(const char *na,int n)
- {std::string str(na);return attribute_history(str,n);}
-//
-// Polling administration methods
-//
- virtual std::vector<std::string> *polling_status();
-
- virtual void poll_command(std::string &, int);
- virtual void poll_command(const char *na, int per) {std::string tmp(na);poll_command(tmp,per);}
- virtual void poll_attribute(std::string &, int);
- virtual void poll_attribute(const char *na, int per) {std::string tmp(na);poll_attribute(tmp,per);}
-
- virtual int get_command_poll_period(std::string &);
- virtual int get_command_poll_period(const char *na)
- {std::string tmp(na);return get_command_poll_period(tmp);}
- virtual int get_attribute_poll_period(std::string &);
- virtual int get_attribute_poll_period(const char *na)
- {std::string tmp(na);return get_attribute_poll_period(tmp);}
-
- virtual bool is_command_polled(std::string &);
- virtual bool is_command_polled(const char *na) {std::string tmp(na);return is_command_polled(tmp);}
- virtual bool is_attribute_polled(std::string &);
- virtual bool is_attribute_polled(const char *na) {std::string tmp(na);return is_attribute_polled(tmp);}
-
- virtual void stop_poll_command(std::string &);
- virtual void stop_poll_command(const char *na) {std::string tmp(na);stop_poll_command(tmp);}
- virtual void stop_poll_attribute(std::string &);
- virtual void stop_poll_attribute(const char *na) {std::string tmp(na);stop_poll_attribute(tmp);}
-//
-// Asynchronous methods
-//
- virtual long read_attribute_asynch(const char *na) {std::string tmp(na);return read_attribute_asynch(tmp);}
- virtual long read_attribute_asynch(std::string &att_name);
- virtual long read_attributes_asynch(vector <std::string> &);
-
- virtual std::vector<DeviceAttribute> *read_attributes_reply(long);
- virtual std::vector<DeviceAttribute> *read_attributes_reply(long,long);
- virtual DeviceAttribute *read_attribute_reply(long);
- virtual DeviceAttribute *read_attribute_reply(long,long);
-
- virtual long write_attribute_asynch(DeviceAttribute &);
- virtual long write_attributes_asynch(vector<DeviceAttribute> &);
-
- virtual void write_attributes_reply(long);
- virtual void write_attributes_reply(long,long);
- virtual void write_attribute_reply(long id) {write_attributes_reply(id);}
- virtual void write_attribute_reply(long to,long id) {write_attributes_reply(to,id);}
-
- virtual long pending_asynch_call(asyn_req_type req)
- {if (req == POLLING)return pasyn_ctr;
- else if (req==CALL_BACK) return pasyn_cb_ctr;
- else return (pasyn_ctr + pasyn_cb_ctr);}
-
- virtual void read_attributes_asynch(vector<std::string> &,CallBack &);
- virtual void read_attribute_asynch(const char *na,CallBack &cb) {std::string tmp(na);read_attribute_asynch(tmp,cb);}
- virtual void read_attribute_asynch(std::string &,CallBack &);
-
- virtual void write_attribute_asynch(DeviceAttribute &,CallBack &);
- virtual void write_attributes_asynch(vector<DeviceAttribute> &,CallBack &);
-//
-// Logging administration methods
-//
-#ifdef TANGO_HAS_LOG4TANGO
- virtual void add_logging_target(const std::string &target_type_name);
- virtual void add_logging_target(const char *target_type_name)
- {add_logging_target(std::string(target_type_name));}
-
- virtual void remove_logging_target(const std::string &target_type_name);
- virtual void remove_logging_target(const char *target_type_name)
- {remove_logging_target(std::string(target_type_name));}
-
- virtual std::vector<std::string> get_logging_target (void);
- virtual int get_logging_level (void);
- virtual void set_logging_level (int level);
-#endif // TANGO_HAS_LOG4TANGO
-//
-// Event methods
-//
- virtual int subscribe_event(const std::string &attr_name, EventType event, CallBack *,
- const std::vector<std::string> &filters); // For compatibility with Tango < 8
- virtual int subscribe_event(const std::string &attr_name, EventType event, CallBack *,
- const std::vector<std::string> &filters, bool stateless); // For compatibility with Tango < 8
- virtual int subscribe_event(const std::string &attr_name, EventType event, int event_queue_size,
- const std::vector<std::string> &filters, bool stateless = false); // For compatibility with Tango < 8
-
- virtual int subscribe_event(const std::string &attr_name, EventType event, CallBack *);
- virtual int subscribe_event(const std::string &attr_name, EventType event, CallBack *,bool stateless);
- virtual int subscribe_event(const std::string &attr_name, EventType event, int event_queue_size,bool stateless = false);
-
- virtual void unsubscribe_event(int event_id);
-//
-// Methods to access data in event queues
-//
- virtual void get_events (int event_id, EventDataList &event_list);
- virtual void get_events (int event_id, AttrConfEventDataList &event_list);
- virtual void get_events (int event_id, DataReadyEventDataList &event_list);
- virtual void get_events (int event_id, CallBack *cb);
- virtual int event_queue_size(int event_id);
- virtual TimeVal get_last_event_date(int event_id);
- virtual bool is_event_queue_empty(int event_id);
-
-//
-// Locking methods
-//
- virtual void lock(int lock_validity=DEFAULT_LOCK_VALIDITY);
- virtual void unlock(bool force=false);
- virtual std::string locking_status();
- virtual bool is_locked();
- virtual bool is_locked_by_me();
- virtual bool get_locker(LockerInfo &);
-*/
-};
-
diff --git a/src/sip/std_utils.sip b/src/sip/std_utils.sip
index ba88508..1e30fd1 100644
--- a/src/sip/std_utils.sip
+++ b/src/sip/std_utils.sip
@@ -39,9 +39,9 @@ if (sipIsErr == NULL)
%ConvertFromTypeCode
return PyString_FromStringAndSize(sipCpp->data(),sipCpp->length());
%End
-
};
+
%MappedType std::vector<std::string>
{
%TypeHeaderCode
@@ -52,17 +52,17 @@ return PyString_FromStringAndSize(sipCpp->data(),sipCpp->length());
%ConvertToTypeCode
if (sipIsErr == NULL)
{
-bool aReturnFlag = PyList_Check(sipPy);
-for(int i = 0;aReturnFlag && i < PyList_Size(sipPy);++i)
- aReturnFlag = PyString_Check(PyList_GET_ITEM(sipPy,i));
-return aReturnFlag;
+ bool aReturnFlag = PyList_Check(sipPy);
+ for(int i = 0;aReturnFlag && i < PyList_Size(sipPy);++i)
+ aReturnFlag = PyString_Check(PyList_GET_ITEM(sipPy,i));
+ return aReturnFlag;
}
*sipCppPtr = new std::vector<std::string>(PyList_Size(sipPy));
for(int i = 0;i < PyList_Size(sipPy);++i)
- (*sipCppPtr)->operator[](i) = PyString_AsString(PyList_GET_ITEM(sipPy,i));
+ (*sipCppPtr)->operator[](i) = PyString_AsString(PyList_GET_ITEM(sipPy,i));
- return sipGetState(sipTransferObj);
+return sipGetState(sipTransferObj);
%End
%ConvertFromTypeCode
@@ -70,13 +70,13 @@ PyObject* aReturnListPt = PyList_New(sipCpp->size());
std::vector<std::string>::iterator vIter = sipCpp->begin();
for(int i = 0;vIter != sipCpp->end();++vIter,++i)
- PyList_SET_ITEM(aReturnListPt,i,PyString_FromStringAndSize(vIter->data(),vIter->length()));
+ PyList_SET_ITEM(aReturnListPt,i,PyString_FromStringAndSize(vIter->data(),vIter->length()));
return aReturnListPt;
%End
-
};
+
%MappedType std::vector<int>
{
%TypeHeaderCode
@@ -111,61 +111,3 @@ return aReturnListPt;
};
-// vector<TYPE> is implemented as a Python vector.
-template<TYPE>
-%MappedType vector<TYPE>
-{
-%TypeHeaderCode
-#include <vector>
-using namespace std;
-%End
-
-%ConvertFromTypeCode
- // Create the vector.
- PyObject *l;
- if ((l = PyList_New(sipCpp->size())) == NULL)
- return NULL;
- // Set the vector elements.
- vector<TYPE>::iterator iter;
- int i(0);
- for (iter = sipCpp->begin(); iter != sipCpp->end(); ++iter) {
- TYPE *t = new TYPE(*iter);
- PyObject *tobj;
- if ((tobj = sipConvertFromNewInstance(t, sipClass_TYPE, sipTransferObj)) == NULL) {
- Py_DECREF(l);
- delete t;
- return NULL;
- }
- PyList_SET_ITEM(l, i++, tobj);
- }
- return l;
-%End
-
-%ConvertToTypeCode
- // Check the type if that is all that is required.
- if (sipIsErr == NULL) {
- if (!PyList_Check(sipPy))
- return 0;
- for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i)
- if (!sipCanConvertToInstance(PyList_GET_ITEM(sipPy, i), sipClass_TYPE, SIP_NOT_NONE))
- return 0;
- return 1;
- }
- vector<TYPE> *qv = new vector<TYPE>;
- for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) {
- int state;
- TYPE *t = reinterpret_cast<TYPE *>(sipConvertToInstance(PyList_GET_ITEM(sipPy, i), sipClass_TYPE, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));
- if (*sipIsErr) {
- sipReleaseInstance(t, sipClass_TYPE, state);
- delete qv;
- return 0;
- }
- qv->push_back(*t);
- sipReleaseInstance(t, sipClass_TYPE, state);
- }
- *sipCppPtr = qv;
- return sipGetState(sipTransferObj);
-%End
-};
-
-
diff --git a/src/sip/tango.sip b/src/sip/tango.sip
deleted file mode 100644
index f5ccc55..0000000
--- a/src/sip/tango.sip
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
-
- This file is part of PyTango, a python binding for Tango
-
- http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html
-
- Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
-
- PyTango is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- PyTango is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with PyTango. If not, see <http://www.gnu.org/licenses/>.
-
-*******************************************************************************/
-
-%Module Tango 008001000
-
-%Timeline { TANGO_8_0 TANGO_8_1 }
-
-%Platforms {WIN32_PLATFORM POSIX_PLATFORM MACOS_PLATFORM}
-
-%Include std_utils.sip
-%Include constants.sip
-%Include command_info.sip
-%Include db_datum.sip
-%Include db_dev_info.sip
-%Include db_dev_import_info.sip
-%Include connection.sip
-%Include device_proxy.sip
-%Include database.sip
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/pytango.git
More information about the debian-science-commits
mailing list