[pytango] 180/483: changes to support multiple bindings
Sandor Bodo-Merle
sbodomerle-guest at moszumanska.debian.org
Thu Sep 28 19:14:38 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 1f986186ceb9e003b7094d95548f08c66ba1df83
Author: tiagocoutinho <tiagocoutinho at 4e9c00fd-8f2e-0410-aa12-93ce3db5e235>
Date: Mon Jan 14 16:05:54 2013 +0000
changes to support multiple bindings
git-svn-id: http://svn.code.sf.net/p/tango-cs/code/bindings/PyTango/trunk@21884 4e9c00fd-8f2e-0410-aa12-93ce3db5e235
---
Makefile | 18 +-
setup.py | 24 ++-
src/{ => boost/cpp}/api_util.cpp | 0
src/{ => boost/cpp}/archive_event_info.cpp | 1 +
src/{ => boost/cpp}/attr_conf_event_data.cpp | 0
src/{ => boost/cpp}/attribute_alarm_info.cpp | 0
src/{ => boost/cpp}/attribute_dimension.cpp | 0
src/{ => boost/cpp}/attribute_event_info.cpp | 0
src/{ => boost/cpp}/attribute_info.cpp | 0
src/{ => boost/cpp}/attribute_info_ex.cpp | 0
src/{ => boost/cpp}/attribute_proxy.cpp | 0
src/{ => boost/cpp}/base_types.cpp | 0
src/{ => boost/cpp}/base_types_numpy.hpp | 0
src/{ => boost/cpp}/callback.cpp | 0
src/{ => boost/cpp}/callback.h | 0
src/{ => boost/cpp}/change_event_info.cpp | 0
src/{ => boost/cpp}/command_info.cpp | 0
src/{ => boost/cpp}/connection.cpp | 0
src/{ => boost/cpp}/constants.cpp | 0
src/{ => boost/cpp}/data_ready_event_data.cpp | 0
src/{ => boost/cpp}/database.cpp | 0
src/{ => boost/cpp}/db.cpp | 0
src/{ => boost/cpp}/defs.h | 0
src/{ => boost/cpp}/dev_command_info.cpp | 0
src/{ => boost/cpp}/dev_error.cpp | 0
src/{ => boost/cpp}/device_attribute.cpp | 0
src/{ => boost/cpp}/device_attribute.h | 0
src/{ => boost/cpp}/device_attribute_config.cpp | 0
src/{ => boost/cpp}/device_attribute_history.cpp | 0
src/{ => boost/cpp}/device_attribute_numpy.hpp | 0
src/{ => boost/cpp}/device_data.cpp | 0
src/{ => boost/cpp}/device_data_history.cpp | 0
src/{ => boost/cpp}/device_info.cpp | 0
src/{ => boost/cpp}/device_proxy.cpp | 0
src/{ => boost/cpp}/enums.cpp | 0
src/{ => boost/cpp}/event_data.cpp | 0
src/{ => boost/cpp}/exception.cpp | 0
src/{ => boost/cpp}/exception.h | 0
src/{ => boost/cpp}/fast_from_py.h | 0
src/{ => boost/cpp}/fast_from_py_numpy.hpp | 0
src/{ => boost/cpp}/from_py.cpp | 0
src/{ => boost/cpp}/from_py.h | 0
src/{ => boost/cpp}/group.cpp | 0
src/{ => boost/cpp}/group_reply.cpp | 0
src/{ => boost/cpp}/group_reply_list.cpp | 0
src/{ => boost/cpp}/locker_info.cpp | 0
src/{ => boost/cpp}/locking_thread.cpp | 0
src/{ => boost/cpp}/periodic_event_info.cpp | 0
src/{ => boost/cpp}/poll_device.cpp | 0
src/{ => boost/cpp}/precompiled_header.cpp | 0
src/{ => boost/cpp}/precompiled_header.hpp | 0
src/{ => boost/cpp}/pytango.cpp | 0
src/{ => boost/cpp}/pytgutils.cpp | 0
src/{ => boost/cpp}/pytgutils.h | 0
src/{ => boost/cpp}/pyutils.cpp | 0
src/{ => boost/cpp}/pyutils.h | 0
src/{ => boost/cpp}/server/attr.cpp | 0
src/{ => boost/cpp}/server/attr.h | 0
src/{ => boost/cpp}/server/attribute.cpp | 0
src/{ => boost/cpp}/server/attribute.h | 0
src/{ => boost/cpp}/server/command.cpp | 0
src/{ => boost/cpp}/server/command.h | 0
src/{ => boost/cpp}/server/device_class.cpp | 0
src/{ => boost/cpp}/server/device_class.h | 0
src/{ => boost/cpp}/server/device_impl.cpp | 0
src/{ => boost/cpp}/server/device_impl.h | 0
src/{ => boost/cpp}/server/dserver.cpp | 0
src/{ => boost/cpp}/server/encoded_attribute.cpp | 0
src/{ => boost/cpp}/server/log4tango.cpp | 0
src/{ => boost/cpp}/server/multi_attribute.cpp | 0
.../cpp}/server/multi_class_attribute.cpp | 0
src/{ => boost/cpp}/server/subdev.cpp | 0
src/{ => boost/cpp}/server/tango_util.cpp | 0
.../cpp}/server/user_default_attr_prop.cpp | 0
src/{ => boost/cpp}/server/wattribute.cpp | 0
src/{ => boost/cpp}/server/wattribute_numpy.hpp | 0
src/{ => boost/cpp}/tango_numpy.h | 0
src/{ => boost/cpp}/tgutils.h | 0
src/{ => boost/cpp}/time_val.cpp | 0
src/{ => boost/cpp}/to_py.cpp | 0
src/{ => boost/cpp}/to_py.h | 0
src/{ => boost/cpp}/to_py_numpy.hpp | 0
src/{ => boost/cpp}/version.cpp | 0
{PyTango => src/boost/python}/__init__.py | 0
{PyTango => src/boost/python}/api2.py | 0
{PyTango => src/boost/python}/api_util.py | 0
{PyTango => src/boost/python}/attr_data.py | 0
{PyTango => src/boost/python}/attribute_proxy.py | 0
{PyTango => src/boost/python}/base_types.py | 1 +
{PyTango => src/boost/python}/callback.py | 0
{PyTango => src/boost/python}/connection.py | 0
.../boost/python}/databaseds/DataBase.xmi | 0
.../boost/python}/databaseds/DataBaseds | 0
.../boost/python}/databaseds/create_db.sql | 0
.../boost/python}/databaseds/create_db_tables.sql | 0
.../boost/python}/databaseds/database.py | 0
.../boost/python}/databaseds/db_access.py | 0
.../boost/python}/databaseds/db_errors.py | 0
.../boost/python}/databaseds/mysql2sqlite.sh | 0
{PyTango => src/boost/python}/db.py | 0
{PyTango => src/boost/python}/device_attribute.py | 0
{PyTango => src/boost/python}/device_class.py | 0
{PyTango => src/boost/python}/device_data.py | 0
{PyTango => src/boost/python}/device_proxy.py | 0
{PyTango => src/boost/python}/device_server.py | 0
{PyTango => src/boost/python}/encoded_attribute.py | 0
{PyTango => src/boost/python}/exception.py | 0
{PyTango => src/boost/python}/globals.py | 0
{PyTango => src/boost/python}/group.py | 0
{PyTango => src/boost/python}/group_reply.py | 0
{PyTango => src/boost/python}/group_reply_list.py | 0
{PyTango => src/boost/python}/ipython/__init__.py | 0
{PyTango => src/boost/python}/ipython/common.py | 0
.../boost/python}/ipython/eventlogger.py | 0
.../python}/ipython/ipython_00_10/__init__.py | 0
.../python}/ipython/ipython_00_10/ipy_install.py | 0
.../boost/python}/ipython/ipython_00_10/ipy_qt.py | 0
.../python}/ipython/ipython_00_10/ipython_00_10.py | 0
.../python}/ipython/ipython_00_11/__init__.py | 0
.../python}/ipython/ipython_00_11/ipy_install.py | 0
.../python}/ipython/ipython_00_11/ipython_00_11.py | 0
.../python}/ipython/resource/ITangoConsole.svg | 0
.../boost/python}/ipython/resource/database.png | Bin
.../boost/python}/ipython/resource/device.png | Bin
.../boost/python}/ipython/resource/motor.png | Bin
.../boost/python}/ipython/resource/serial.png | Bin
.../boost/python}/ipython/resource/starter.png | Bin
{PyTango => src/boost/python}/log4tango.py | 0
{PyTango => src/boost/python}/pytango_init.py | 0
{PyTango => src/boost/python}/pytango_pprint.py | 0
{PyTango => src/boost/python}/pyutil.py | 0
{PyTango => src/boost/python}/release.py | 0
{PyTango => src/boost/python}/tango_numpy.py | 0
{PyTango => src/boost/python}/time_val.py | 0
{PyTango => src/boost/python}/utils.py | 0
src/sip/configure.py | 26 +++
src/{dev_error.cpp => sip/connection.sip} | 54 +++--
src/sip/constants.sip | 178 ++++++++++++++++
src/sip/database.sip | 193 +++++++++++++++++
src/sip/dbdatum.sip | 123 +++++++++++
src/sip/deviceproxy.sip | 232 +++++++++++++++++++++
src/sip/stdutils.sip | 113 ++++++++++
src/{pytgutils.cpp => sip/tango.sip} | 12 +-
143 files changed, 934 insertions(+), 41 deletions(-)
diff --git a/Makefile b/Makefile
index dde091b..960debb 100644
--- a/Makefile
+++ b/Makefile
@@ -69,7 +69,7 @@ prefix=$(_PY_DIR)/site-packages
endif
endif
-SRC_DIR = src
+SRC_DIR = src/boost/cpp
ifndef OBJS_DIR
OBJS_DIR = objs_py$(PY_VER_S)
@@ -78,13 +78,16 @@ endif
CC = gcc
PY_INC = $(shell python$(PY_VER)-config --includes)
+OPTIMIZE_CC = -g -O0
+OPTIMIZE_LN = -O0
+
NUMPY_INC = -I$(NUMPY_ROOT)/include
TANGO_INC = -I$(TANGO_ROOT)/include
PRE_C_H = precompiled_header.hpp
PRE_C_H_O = $(OBJS_DIR)/$(PRE_C_H).gch
PRE_C = -include$(OBJS_DIR)/$(PRE_C_H)
-LN = g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions
-LN_STATIC = g++ -pthread -static -Wl,-O1 -Wl,-Bsymbolic-functions
+LN = g++ -pthread -shared -Wl,$(OPTIMIZE_LN) -Wl,-Bsymbolic-functions
+LN_STATIC = g++ -pthread -static -Wl,$(OPTIMIZE_LN) -Wl,-Bsymbolic-functions
LN_VER = -Wl,-h -Wl,--strip-all
BOOST_LIB = boost_python-py$(PY_VER_S)
LN_LIBS = -ltango -llog4tango -lpthread -lrt -ldl -lomniORB4 -lomniDynamic4 -lomnithread -lCOS4 -l$(BOOST_LIB) -lzmq
@@ -107,13 +110,14 @@ endif
#LN_DIRS = -L$(TANGO_ROOT)/lib -L$(LOG4TANGO_ROOT)/lib -L$(OMNI_ROOT)/lib -L$(BOOST_ROOT)/lib -L$(ZMQ_ROOT)/lib
INCLUDE_DIRS = \
- -Isrc \
+ -I$(SRC_DIR) \
+ -I$(SRC_DIR)\server \
$(TANGO_INC) \
$(TANGO_INC)/tango \
$(PY_INC) \
$(NUMPY_INC)
-CCFLAGS = -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -fPIC -std=c++0x -DPYTANGO_HAS_UNIQUE_PTR $(INCLUDE_DIRS)
+CCFLAGS = -pthread -fno-strict-aliasing -DNDEBUG $(OPTIMIZE_CC) -fwrapv -Wall -fPIC -std=c++0x -DPYTANGO_HAS_UNIQUE_PTR $(INCLUDE_DIRS)
LIB_NAME = _PyTango.so
LIB_NAME_STATIC = _PyTangoStatic.so
@@ -245,8 +249,8 @@ clean:
rm -rf $(OBJS_DIR)
install-py:
- mkdir -p $(prefix)
- rsync -r PyTango $(prefix)
+ mkdir -p $(prefix)/PyTango
+ rsync -r src/boost/python/ $(prefix)/PyTango/
install: build install-py
rsync $(OBJS_DIR)/$(LIB_NAME) $(prefix)/PyTango
diff --git a/setup.py b/setup.py
index 2b14f45..70cbc83 100644
--- a/setup.py
+++ b/setup.py
@@ -71,7 +71,7 @@ def abspath(*path):
def get_release_info():
name = "release"
- release_dir = abspath('PyTango')
+ release_dir = abspath('src', 'boost', 'python')
data = imp.find_module(name, [release_dir])
release = imp.load_module(name, *data)
return release.Release
@@ -443,12 +443,18 @@ def main():
'omnithread',
'COS4',
]
-
- # when building with multiple version of python on debian we need
- # to link against boost_python-py25/-py26 etc...
- pyver = "py" + "".join(map(str, platform.python_version_tuple()[:2]))
- dist = platform.dist()[0].lower()
- libraries.append('boost_python-' + pyver)
+
+ boost_library_name = 'boost_python'
+
+ if 'linux' in sys.platform:
+ dist_name = platform.linux_distribution()[0].lower()
+ debian_based = 'debian' in dist_name or 'ubuntu' in dist_name
+ if debian_based:
+ # when building with multiple version of python on debian we need
+ # to link against boost_python-py25/-py26 etc...
+ pyver = "-py" + "".join(map(str, platform.python_version_tuple()[:2]))
+ boost_library_name += pyver
+ libraries.append(boost_library_name)
library_dirs += [ os.path.join(OMNI_ROOT, 'lib') ]
@@ -474,7 +480,7 @@ def main():
include_dirs = uniquify(include_dirs)
library_dirs = uniquify(library_dirs)
- src_dir = abspath('src')
+ src_dir = abspath('src', 'boost', 'cpp')
client_dir = src_dir
server_dir = os.path.join(src_dir, 'server')
_clientfiles = [ os.path.join(client_dir,fname) for fname in os.listdir(client_dir) if fname.endswith('.cpp') ]
@@ -515,7 +521,7 @@ def main():
platforms = Release.platform,
license = Release.license,
packages = packages,
- package_dir = { 'PyTango' : 'PyTango' },
+ package_dir = { 'PyTango' : os.path.join('src', 'boost', 'python') },
py_modules = py_modules,
classifiers = classifiers,
package_data = package_data,
diff --git a/src/api_util.cpp b/src/boost/cpp/api_util.cpp
similarity index 100%
rename from src/api_util.cpp
rename to src/boost/cpp/api_util.cpp
diff --git a/src/archive_event_info.cpp b/src/boost/cpp/archive_event_info.cpp
similarity index 94%
rename from src/archive_event_info.cpp
rename to src/boost/cpp/archive_event_info.cpp
index 675f358..78cfc7a 100644
--- a/src/archive_event_info.cpp
+++ b/src/boost/cpp/archive_event_info.cpp
@@ -31,6 +31,7 @@ void export_archive_event_info()
class_<Tango::ArchiveEventInfo>("ArchiveEventInfo")
.def_readwrite("archive_rel_change", &Tango::ArchiveEventInfo::archive_rel_change)
.def_readwrite("archive_abs_change", &Tango::ArchiveEventInfo::archive_abs_change)
+ .def_readwrite("archive_period", &Tango::ArchiveEventInfo::archive_period)
.def_readwrite("extensions", &Tango::ArchiveEventInfo::extensions)
;
}
diff --git a/src/attr_conf_event_data.cpp b/src/boost/cpp/attr_conf_event_data.cpp
similarity index 100%
rename from src/attr_conf_event_data.cpp
rename to src/boost/cpp/attr_conf_event_data.cpp
diff --git a/src/attribute_alarm_info.cpp b/src/boost/cpp/attribute_alarm_info.cpp
similarity index 100%
rename from src/attribute_alarm_info.cpp
rename to src/boost/cpp/attribute_alarm_info.cpp
diff --git a/src/attribute_dimension.cpp b/src/boost/cpp/attribute_dimension.cpp
similarity index 100%
rename from src/attribute_dimension.cpp
rename to src/boost/cpp/attribute_dimension.cpp
diff --git a/src/attribute_event_info.cpp b/src/boost/cpp/attribute_event_info.cpp
similarity index 100%
rename from src/attribute_event_info.cpp
rename to src/boost/cpp/attribute_event_info.cpp
diff --git a/src/attribute_info.cpp b/src/boost/cpp/attribute_info.cpp
similarity index 100%
rename from src/attribute_info.cpp
rename to src/boost/cpp/attribute_info.cpp
diff --git a/src/attribute_info_ex.cpp b/src/boost/cpp/attribute_info_ex.cpp
similarity index 100%
rename from src/attribute_info_ex.cpp
rename to src/boost/cpp/attribute_info_ex.cpp
diff --git a/src/attribute_proxy.cpp b/src/boost/cpp/attribute_proxy.cpp
similarity index 100%
rename from src/attribute_proxy.cpp
rename to src/boost/cpp/attribute_proxy.cpp
diff --git a/src/base_types.cpp b/src/boost/cpp/base_types.cpp
similarity index 100%
rename from src/base_types.cpp
rename to src/boost/cpp/base_types.cpp
diff --git a/src/base_types_numpy.hpp b/src/boost/cpp/base_types_numpy.hpp
similarity index 100%
rename from src/base_types_numpy.hpp
rename to src/boost/cpp/base_types_numpy.hpp
diff --git a/src/callback.cpp b/src/boost/cpp/callback.cpp
similarity index 100%
rename from src/callback.cpp
rename to src/boost/cpp/callback.cpp
diff --git a/src/callback.h b/src/boost/cpp/callback.h
similarity index 100%
rename from src/callback.h
rename to src/boost/cpp/callback.h
diff --git a/src/change_event_info.cpp b/src/boost/cpp/change_event_info.cpp
similarity index 100%
rename from src/change_event_info.cpp
rename to src/boost/cpp/change_event_info.cpp
diff --git a/src/command_info.cpp b/src/boost/cpp/command_info.cpp
similarity index 100%
rename from src/command_info.cpp
rename to src/boost/cpp/command_info.cpp
diff --git a/src/connection.cpp b/src/boost/cpp/connection.cpp
similarity index 100%
rename from src/connection.cpp
rename to src/boost/cpp/connection.cpp
diff --git a/src/constants.cpp b/src/boost/cpp/constants.cpp
similarity index 100%
rename from src/constants.cpp
rename to src/boost/cpp/constants.cpp
diff --git a/src/data_ready_event_data.cpp b/src/boost/cpp/data_ready_event_data.cpp
similarity index 100%
rename from src/data_ready_event_data.cpp
rename to src/boost/cpp/data_ready_event_data.cpp
diff --git a/src/database.cpp b/src/boost/cpp/database.cpp
similarity index 100%
rename from src/database.cpp
rename to src/boost/cpp/database.cpp
diff --git a/src/db.cpp b/src/boost/cpp/db.cpp
similarity index 100%
rename from src/db.cpp
rename to src/boost/cpp/db.cpp
diff --git a/src/defs.h b/src/boost/cpp/defs.h
similarity index 100%
rename from src/defs.h
rename to src/boost/cpp/defs.h
diff --git a/src/dev_command_info.cpp b/src/boost/cpp/dev_command_info.cpp
similarity index 100%
rename from src/dev_command_info.cpp
rename to src/boost/cpp/dev_command_info.cpp
diff --git a/src/dev_error.cpp b/src/boost/cpp/dev_error.cpp
similarity index 100%
copy from src/dev_error.cpp
copy to src/boost/cpp/dev_error.cpp
diff --git a/src/device_attribute.cpp b/src/boost/cpp/device_attribute.cpp
similarity index 100%
rename from src/device_attribute.cpp
rename to src/boost/cpp/device_attribute.cpp
diff --git a/src/device_attribute.h b/src/boost/cpp/device_attribute.h
similarity index 100%
rename from src/device_attribute.h
rename to src/boost/cpp/device_attribute.h
diff --git a/src/device_attribute_config.cpp b/src/boost/cpp/device_attribute_config.cpp
similarity index 100%
rename from src/device_attribute_config.cpp
rename to src/boost/cpp/device_attribute_config.cpp
diff --git a/src/device_attribute_history.cpp b/src/boost/cpp/device_attribute_history.cpp
similarity index 100%
rename from src/device_attribute_history.cpp
rename to src/boost/cpp/device_attribute_history.cpp
diff --git a/src/device_attribute_numpy.hpp b/src/boost/cpp/device_attribute_numpy.hpp
similarity index 100%
rename from src/device_attribute_numpy.hpp
rename to src/boost/cpp/device_attribute_numpy.hpp
diff --git a/src/device_data.cpp b/src/boost/cpp/device_data.cpp
similarity index 100%
rename from src/device_data.cpp
rename to src/boost/cpp/device_data.cpp
diff --git a/src/device_data_history.cpp b/src/boost/cpp/device_data_history.cpp
similarity index 100%
rename from src/device_data_history.cpp
rename to src/boost/cpp/device_data_history.cpp
diff --git a/src/device_info.cpp b/src/boost/cpp/device_info.cpp
similarity index 100%
rename from src/device_info.cpp
rename to src/boost/cpp/device_info.cpp
diff --git a/src/device_proxy.cpp b/src/boost/cpp/device_proxy.cpp
similarity index 100%
rename from src/device_proxy.cpp
rename to src/boost/cpp/device_proxy.cpp
diff --git a/src/enums.cpp b/src/boost/cpp/enums.cpp
similarity index 100%
rename from src/enums.cpp
rename to src/boost/cpp/enums.cpp
diff --git a/src/event_data.cpp b/src/boost/cpp/event_data.cpp
similarity index 100%
rename from src/event_data.cpp
rename to src/boost/cpp/event_data.cpp
diff --git a/src/exception.cpp b/src/boost/cpp/exception.cpp
similarity index 100%
rename from src/exception.cpp
rename to src/boost/cpp/exception.cpp
diff --git a/src/exception.h b/src/boost/cpp/exception.h
similarity index 100%
rename from src/exception.h
rename to src/boost/cpp/exception.h
diff --git a/src/fast_from_py.h b/src/boost/cpp/fast_from_py.h
similarity index 100%
rename from src/fast_from_py.h
rename to src/boost/cpp/fast_from_py.h
diff --git a/src/fast_from_py_numpy.hpp b/src/boost/cpp/fast_from_py_numpy.hpp
similarity index 100%
rename from src/fast_from_py_numpy.hpp
rename to src/boost/cpp/fast_from_py_numpy.hpp
diff --git a/src/from_py.cpp b/src/boost/cpp/from_py.cpp
similarity index 100%
rename from src/from_py.cpp
rename to src/boost/cpp/from_py.cpp
diff --git a/src/from_py.h b/src/boost/cpp/from_py.h
similarity index 100%
rename from src/from_py.h
rename to src/boost/cpp/from_py.h
diff --git a/src/group.cpp b/src/boost/cpp/group.cpp
similarity index 100%
rename from src/group.cpp
rename to src/boost/cpp/group.cpp
diff --git a/src/group_reply.cpp b/src/boost/cpp/group_reply.cpp
similarity index 100%
rename from src/group_reply.cpp
rename to src/boost/cpp/group_reply.cpp
diff --git a/src/group_reply_list.cpp b/src/boost/cpp/group_reply_list.cpp
similarity index 100%
rename from src/group_reply_list.cpp
rename to src/boost/cpp/group_reply_list.cpp
diff --git a/src/locker_info.cpp b/src/boost/cpp/locker_info.cpp
similarity index 100%
rename from src/locker_info.cpp
rename to src/boost/cpp/locker_info.cpp
diff --git a/src/locking_thread.cpp b/src/boost/cpp/locking_thread.cpp
similarity index 100%
rename from src/locking_thread.cpp
rename to src/boost/cpp/locking_thread.cpp
diff --git a/src/periodic_event_info.cpp b/src/boost/cpp/periodic_event_info.cpp
similarity index 100%
rename from src/periodic_event_info.cpp
rename to src/boost/cpp/periodic_event_info.cpp
diff --git a/src/poll_device.cpp b/src/boost/cpp/poll_device.cpp
similarity index 100%
rename from src/poll_device.cpp
rename to src/boost/cpp/poll_device.cpp
diff --git a/src/precompiled_header.cpp b/src/boost/cpp/precompiled_header.cpp
similarity index 100%
rename from src/precompiled_header.cpp
rename to src/boost/cpp/precompiled_header.cpp
diff --git a/src/precompiled_header.hpp b/src/boost/cpp/precompiled_header.hpp
similarity index 100%
rename from src/precompiled_header.hpp
rename to src/boost/cpp/precompiled_header.hpp
diff --git a/src/pytango.cpp b/src/boost/cpp/pytango.cpp
similarity index 100%
rename from src/pytango.cpp
rename to src/boost/cpp/pytango.cpp
diff --git a/src/pytgutils.cpp b/src/boost/cpp/pytgutils.cpp
similarity index 100%
copy from src/pytgutils.cpp
copy to src/boost/cpp/pytgutils.cpp
diff --git a/src/pytgutils.h b/src/boost/cpp/pytgutils.h
similarity index 100%
rename from src/pytgutils.h
rename to src/boost/cpp/pytgutils.h
diff --git a/src/pyutils.cpp b/src/boost/cpp/pyutils.cpp
similarity index 100%
rename from src/pyutils.cpp
rename to src/boost/cpp/pyutils.cpp
diff --git a/src/pyutils.h b/src/boost/cpp/pyutils.h
similarity index 100%
rename from src/pyutils.h
rename to src/boost/cpp/pyutils.h
diff --git a/src/server/attr.cpp b/src/boost/cpp/server/attr.cpp
similarity index 100%
rename from src/server/attr.cpp
rename to src/boost/cpp/server/attr.cpp
diff --git a/src/server/attr.h b/src/boost/cpp/server/attr.h
similarity index 100%
rename from src/server/attr.h
rename to src/boost/cpp/server/attr.h
diff --git a/src/server/attribute.cpp b/src/boost/cpp/server/attribute.cpp
similarity index 100%
rename from src/server/attribute.cpp
rename to src/boost/cpp/server/attribute.cpp
diff --git a/src/server/attribute.h b/src/boost/cpp/server/attribute.h
similarity index 100%
rename from src/server/attribute.h
rename to src/boost/cpp/server/attribute.h
diff --git a/src/server/command.cpp b/src/boost/cpp/server/command.cpp
similarity index 100%
rename from src/server/command.cpp
rename to src/boost/cpp/server/command.cpp
diff --git a/src/server/command.h b/src/boost/cpp/server/command.h
similarity index 100%
rename from src/server/command.h
rename to src/boost/cpp/server/command.h
diff --git a/src/server/device_class.cpp b/src/boost/cpp/server/device_class.cpp
similarity index 100%
rename from src/server/device_class.cpp
rename to src/boost/cpp/server/device_class.cpp
diff --git a/src/server/device_class.h b/src/boost/cpp/server/device_class.h
similarity index 100%
rename from src/server/device_class.h
rename to src/boost/cpp/server/device_class.h
diff --git a/src/server/device_impl.cpp b/src/boost/cpp/server/device_impl.cpp
similarity index 100%
rename from src/server/device_impl.cpp
rename to src/boost/cpp/server/device_impl.cpp
diff --git a/src/server/device_impl.h b/src/boost/cpp/server/device_impl.h
similarity index 100%
rename from src/server/device_impl.h
rename to src/boost/cpp/server/device_impl.h
diff --git a/src/server/dserver.cpp b/src/boost/cpp/server/dserver.cpp
similarity index 100%
rename from src/server/dserver.cpp
rename to src/boost/cpp/server/dserver.cpp
diff --git a/src/server/encoded_attribute.cpp b/src/boost/cpp/server/encoded_attribute.cpp
similarity index 100%
rename from src/server/encoded_attribute.cpp
rename to src/boost/cpp/server/encoded_attribute.cpp
diff --git a/src/server/log4tango.cpp b/src/boost/cpp/server/log4tango.cpp
similarity index 100%
rename from src/server/log4tango.cpp
rename to src/boost/cpp/server/log4tango.cpp
diff --git a/src/server/multi_attribute.cpp b/src/boost/cpp/server/multi_attribute.cpp
similarity index 100%
rename from src/server/multi_attribute.cpp
rename to src/boost/cpp/server/multi_attribute.cpp
diff --git a/src/server/multi_class_attribute.cpp b/src/boost/cpp/server/multi_class_attribute.cpp
similarity index 100%
rename from src/server/multi_class_attribute.cpp
rename to src/boost/cpp/server/multi_class_attribute.cpp
diff --git a/src/server/subdev.cpp b/src/boost/cpp/server/subdev.cpp
similarity index 100%
rename from src/server/subdev.cpp
rename to src/boost/cpp/server/subdev.cpp
diff --git a/src/server/tango_util.cpp b/src/boost/cpp/server/tango_util.cpp
similarity index 100%
rename from src/server/tango_util.cpp
rename to src/boost/cpp/server/tango_util.cpp
diff --git a/src/server/user_default_attr_prop.cpp b/src/boost/cpp/server/user_default_attr_prop.cpp
similarity index 100%
rename from src/server/user_default_attr_prop.cpp
rename to src/boost/cpp/server/user_default_attr_prop.cpp
diff --git a/src/server/wattribute.cpp b/src/boost/cpp/server/wattribute.cpp
similarity index 100%
rename from src/server/wattribute.cpp
rename to src/boost/cpp/server/wattribute.cpp
diff --git a/src/server/wattribute_numpy.hpp b/src/boost/cpp/server/wattribute_numpy.hpp
similarity index 100%
rename from src/server/wattribute_numpy.hpp
rename to src/boost/cpp/server/wattribute_numpy.hpp
diff --git a/src/tango_numpy.h b/src/boost/cpp/tango_numpy.h
similarity index 100%
rename from src/tango_numpy.h
rename to src/boost/cpp/tango_numpy.h
diff --git a/src/tgutils.h b/src/boost/cpp/tgutils.h
similarity index 100%
rename from src/tgutils.h
rename to src/boost/cpp/tgutils.h
diff --git a/src/time_val.cpp b/src/boost/cpp/time_val.cpp
similarity index 100%
rename from src/time_val.cpp
rename to src/boost/cpp/time_val.cpp
diff --git a/src/to_py.cpp b/src/boost/cpp/to_py.cpp
similarity index 100%
rename from src/to_py.cpp
rename to src/boost/cpp/to_py.cpp
diff --git a/src/to_py.h b/src/boost/cpp/to_py.h
similarity index 100%
rename from src/to_py.h
rename to src/boost/cpp/to_py.h
diff --git a/src/to_py_numpy.hpp b/src/boost/cpp/to_py_numpy.hpp
similarity index 100%
rename from src/to_py_numpy.hpp
rename to src/boost/cpp/to_py_numpy.hpp
diff --git a/src/version.cpp b/src/boost/cpp/version.cpp
similarity index 100%
rename from src/version.cpp
rename to src/boost/cpp/version.cpp
diff --git a/PyTango/__init__.py b/src/boost/python/__init__.py
similarity index 100%
rename from PyTango/__init__.py
rename to src/boost/python/__init__.py
diff --git a/PyTango/api2.py b/src/boost/python/api2.py
similarity index 100%
rename from PyTango/api2.py
rename to src/boost/python/api2.py
diff --git a/PyTango/api_util.py b/src/boost/python/api_util.py
similarity index 100%
rename from PyTango/api_util.py
rename to src/boost/python/api_util.py
diff --git a/PyTango/attr_data.py b/src/boost/python/attr_data.py
similarity index 100%
rename from PyTango/attr_data.py
rename to src/boost/python/attr_data.py
diff --git a/PyTango/attribute_proxy.py b/src/boost/python/attribute_proxy.py
similarity index 100%
rename from PyTango/attribute_proxy.py
rename to src/boost/python/attribute_proxy.py
diff --git a/PyTango/base_types.py b/src/boost/python/base_types.py
similarity index 99%
rename from PyTango/base_types.py
rename to src/boost/python/base_types.py
index af433d2..6e25eb9 100644
--- a/PyTango/base_types.py
+++ b/src/boost/python/base_types.py
@@ -390,6 +390,7 @@ def __doc_base_types():
- archive_rel_change : (str) relative change that will generate an event
- archive_abs_change : (str) absolute change that will generate an event
+ - archive_period : (str) archive period
- extensions : (sequence<str>) extensions (currently not used)"""
EventData.__doc__ = """
diff --git a/PyTango/callback.py b/src/boost/python/callback.py
similarity index 100%
rename from PyTango/callback.py
rename to src/boost/python/callback.py
diff --git a/PyTango/connection.py b/src/boost/python/connection.py
similarity index 100%
rename from PyTango/connection.py
rename to src/boost/python/connection.py
diff --git a/PyTango/databaseds/DataBase.xmi b/src/boost/python/databaseds/DataBase.xmi
similarity index 100%
rename from PyTango/databaseds/DataBase.xmi
rename to src/boost/python/databaseds/DataBase.xmi
diff --git a/PyTango/databaseds/DataBaseds b/src/boost/python/databaseds/DataBaseds
similarity index 100%
rename from PyTango/databaseds/DataBaseds
rename to src/boost/python/databaseds/DataBaseds
diff --git a/PyTango/databaseds/create_db.sql b/src/boost/python/databaseds/create_db.sql
similarity index 100%
rename from PyTango/databaseds/create_db.sql
rename to src/boost/python/databaseds/create_db.sql
diff --git a/PyTango/databaseds/create_db_tables.sql b/src/boost/python/databaseds/create_db_tables.sql
similarity index 100%
rename from PyTango/databaseds/create_db_tables.sql
rename to src/boost/python/databaseds/create_db_tables.sql
diff --git a/PyTango/databaseds/database.py b/src/boost/python/databaseds/database.py
similarity index 100%
rename from PyTango/databaseds/database.py
rename to src/boost/python/databaseds/database.py
diff --git a/PyTango/databaseds/db_access.py b/src/boost/python/databaseds/db_access.py
similarity index 100%
rename from PyTango/databaseds/db_access.py
rename to src/boost/python/databaseds/db_access.py
diff --git a/PyTango/databaseds/db_errors.py b/src/boost/python/databaseds/db_errors.py
similarity index 100%
rename from PyTango/databaseds/db_errors.py
rename to src/boost/python/databaseds/db_errors.py
diff --git a/PyTango/databaseds/mysql2sqlite.sh b/src/boost/python/databaseds/mysql2sqlite.sh
similarity index 100%
rename from PyTango/databaseds/mysql2sqlite.sh
rename to src/boost/python/databaseds/mysql2sqlite.sh
diff --git a/PyTango/db.py b/src/boost/python/db.py
similarity index 100%
rename from PyTango/db.py
rename to src/boost/python/db.py
diff --git a/PyTango/device_attribute.py b/src/boost/python/device_attribute.py
similarity index 100%
rename from PyTango/device_attribute.py
rename to src/boost/python/device_attribute.py
diff --git a/PyTango/device_class.py b/src/boost/python/device_class.py
similarity index 100%
rename from PyTango/device_class.py
rename to src/boost/python/device_class.py
diff --git a/PyTango/device_data.py b/src/boost/python/device_data.py
similarity index 100%
rename from PyTango/device_data.py
rename to src/boost/python/device_data.py
diff --git a/PyTango/device_proxy.py b/src/boost/python/device_proxy.py
similarity index 100%
rename from PyTango/device_proxy.py
rename to src/boost/python/device_proxy.py
diff --git a/PyTango/device_server.py b/src/boost/python/device_server.py
similarity index 100%
rename from PyTango/device_server.py
rename to src/boost/python/device_server.py
diff --git a/PyTango/encoded_attribute.py b/src/boost/python/encoded_attribute.py
similarity index 100%
rename from PyTango/encoded_attribute.py
rename to src/boost/python/encoded_attribute.py
diff --git a/PyTango/exception.py b/src/boost/python/exception.py
similarity index 100%
rename from PyTango/exception.py
rename to src/boost/python/exception.py
diff --git a/PyTango/globals.py b/src/boost/python/globals.py
similarity index 100%
rename from PyTango/globals.py
rename to src/boost/python/globals.py
diff --git a/PyTango/group.py b/src/boost/python/group.py
similarity index 100%
rename from PyTango/group.py
rename to src/boost/python/group.py
diff --git a/PyTango/group_reply.py b/src/boost/python/group_reply.py
similarity index 100%
rename from PyTango/group_reply.py
rename to src/boost/python/group_reply.py
diff --git a/PyTango/group_reply_list.py b/src/boost/python/group_reply_list.py
similarity index 100%
rename from PyTango/group_reply_list.py
rename to src/boost/python/group_reply_list.py
diff --git a/PyTango/ipython/__init__.py b/src/boost/python/ipython/__init__.py
similarity index 100%
rename from PyTango/ipython/__init__.py
rename to src/boost/python/ipython/__init__.py
diff --git a/PyTango/ipython/common.py b/src/boost/python/ipython/common.py
similarity index 100%
rename from PyTango/ipython/common.py
rename to src/boost/python/ipython/common.py
diff --git a/PyTango/ipython/eventlogger.py b/src/boost/python/ipython/eventlogger.py
similarity index 100%
rename from PyTango/ipython/eventlogger.py
rename to src/boost/python/ipython/eventlogger.py
diff --git a/PyTango/ipython/ipython_00_10/__init__.py b/src/boost/python/ipython/ipython_00_10/__init__.py
similarity index 100%
rename from PyTango/ipython/ipython_00_10/__init__.py
rename to src/boost/python/ipython/ipython_00_10/__init__.py
diff --git a/PyTango/ipython/ipython_00_10/ipy_install.py b/src/boost/python/ipython/ipython_00_10/ipy_install.py
similarity index 100%
rename from PyTango/ipython/ipython_00_10/ipy_install.py
rename to src/boost/python/ipython/ipython_00_10/ipy_install.py
diff --git a/PyTango/ipython/ipython_00_10/ipy_qt.py b/src/boost/python/ipython/ipython_00_10/ipy_qt.py
similarity index 100%
rename from PyTango/ipython/ipython_00_10/ipy_qt.py
rename to src/boost/python/ipython/ipython_00_10/ipy_qt.py
diff --git a/PyTango/ipython/ipython_00_10/ipython_00_10.py b/src/boost/python/ipython/ipython_00_10/ipython_00_10.py
similarity index 100%
rename from PyTango/ipython/ipython_00_10/ipython_00_10.py
rename to src/boost/python/ipython/ipython_00_10/ipython_00_10.py
diff --git a/PyTango/ipython/ipython_00_11/__init__.py b/src/boost/python/ipython/ipython_00_11/__init__.py
similarity index 100%
rename from PyTango/ipython/ipython_00_11/__init__.py
rename to src/boost/python/ipython/ipython_00_11/__init__.py
diff --git a/PyTango/ipython/ipython_00_11/ipy_install.py b/src/boost/python/ipython/ipython_00_11/ipy_install.py
similarity index 100%
rename from PyTango/ipython/ipython_00_11/ipy_install.py
rename to src/boost/python/ipython/ipython_00_11/ipy_install.py
diff --git a/PyTango/ipython/ipython_00_11/ipython_00_11.py b/src/boost/python/ipython/ipython_00_11/ipython_00_11.py
similarity index 100%
rename from PyTango/ipython/ipython_00_11/ipython_00_11.py
rename to src/boost/python/ipython/ipython_00_11/ipython_00_11.py
diff --git a/PyTango/ipython/resource/ITangoConsole.svg b/src/boost/python/ipython/resource/ITangoConsole.svg
similarity index 100%
rename from PyTango/ipython/resource/ITangoConsole.svg
rename to src/boost/python/ipython/resource/ITangoConsole.svg
diff --git a/PyTango/ipython/resource/database.png b/src/boost/python/ipython/resource/database.png
similarity index 100%
rename from PyTango/ipython/resource/database.png
rename to src/boost/python/ipython/resource/database.png
diff --git a/PyTango/ipython/resource/device.png b/src/boost/python/ipython/resource/device.png
similarity index 100%
rename from PyTango/ipython/resource/device.png
rename to src/boost/python/ipython/resource/device.png
diff --git a/PyTango/ipython/resource/motor.png b/src/boost/python/ipython/resource/motor.png
similarity index 100%
rename from PyTango/ipython/resource/motor.png
rename to src/boost/python/ipython/resource/motor.png
diff --git a/PyTango/ipython/resource/serial.png b/src/boost/python/ipython/resource/serial.png
similarity index 100%
rename from PyTango/ipython/resource/serial.png
rename to src/boost/python/ipython/resource/serial.png
diff --git a/PyTango/ipython/resource/starter.png b/src/boost/python/ipython/resource/starter.png
similarity index 100%
rename from PyTango/ipython/resource/starter.png
rename to src/boost/python/ipython/resource/starter.png
diff --git a/PyTango/log4tango.py b/src/boost/python/log4tango.py
similarity index 100%
rename from PyTango/log4tango.py
rename to src/boost/python/log4tango.py
diff --git a/PyTango/pytango_init.py b/src/boost/python/pytango_init.py
similarity index 100%
rename from PyTango/pytango_init.py
rename to src/boost/python/pytango_init.py
diff --git a/PyTango/pytango_pprint.py b/src/boost/python/pytango_pprint.py
similarity index 100%
rename from PyTango/pytango_pprint.py
rename to src/boost/python/pytango_pprint.py
diff --git a/PyTango/pyutil.py b/src/boost/python/pyutil.py
similarity index 100%
rename from PyTango/pyutil.py
rename to src/boost/python/pyutil.py
diff --git a/PyTango/release.py b/src/boost/python/release.py
similarity index 100%
rename from PyTango/release.py
rename to src/boost/python/release.py
diff --git a/PyTango/tango_numpy.py b/src/boost/python/tango_numpy.py
similarity index 100%
rename from PyTango/tango_numpy.py
rename to src/boost/python/tango_numpy.py
diff --git a/PyTango/time_val.py b/src/boost/python/time_val.py
similarity index 100%
rename from PyTango/time_val.py
rename to src/boost/python/time_val.py
diff --git a/PyTango/utils.py b/src/boost/python/utils.py
similarity index 100%
rename from PyTango/utils.py
rename to src/boost/python/utils.py
diff --git a/src/sip/configure.py b/src/sip/configure.py
new file mode 100644
index 0000000..81e945e
--- /dev/null
+++ b/src/sip/configure.py
@@ -0,0 +1,26 @@
+import os
+import sipconfig
+
+# The name of the SIP build file generated by SIP and used by the build
+# system.
+build_file = "tango.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"]))
+
+# Create the Makefile.
+makefile = sipconfig.SIPModuleMakefile(config, build_file)
+
+# Add the library we are wrapping. The name doesn't include any platform
+# specific prefixes or extensions (e.g. the "lib" prefix on UNIX, or the
+# ".dll" extension on Windows).
+makefile.extra_libs = ["tango", "zmq"]
+makefile.extra_lib_dirs = ["/home/tcoutinho/.local/lib"]
+makefile.extra_include_dirs = ["/home/tcoutinho/.local/include", "/home/tcoutinho/.local/include/tango"]
+makefile.extra_cxxflags = ["-std=c++0x"]
+
+# Generate the Makefile itself.
+makefile.generate()
diff --git a/src/dev_error.cpp b/src/sip/connection.sip
similarity index 53%
rename from src/dev_error.cpp
rename to src/sip/connection.sip
index c630721..fa05444 100644
--- a/src/dev_error.cpp
+++ b/src/sip/connection.sip
@@ -21,29 +21,43 @@
*******************************************************************************/
-#include "precompiled_header.hpp"
-#include "pyutils.h"
+class Connection {
+
+%TypeHeaderCode
#include <tango.h>
+using namespace Tango;
+%End
-struct PyDevError
-{
- static inline PyObject* get_reason(Tango::DevError &de)
- { return from_char_to_str(de.reason); }
+protected:
- static inline PyObject* get_desc(Tango::DevError &de)
- { return from_char_to_str(de.desc); }
+ virtual std::string get_corba_name(bool)=0;
+ virtual std::string build_corba_name()=0;
+ virtual int get_lock_ctr()=0;
+ virtual void set_lock_ctr(int)=0;
- static inline PyObject* get_origin(Tango::DevError &de)
- { return from_char_to_str(de.origin); }
+public:
+ virtual std::string dev_name()=0;
-};
+ std::string &get_db_host();
+ std::string &get_db_port();
+ int get_db_port_num();
+ bool get_from_env_var();
+ static void get_fqdn(std::string &);
+
+ bool is_dbase_used();
+ std::string &get_dev_host();
+ std::string &get_dev_port();
-void export_dev_error()
-{
- bopy::class_<Tango::DevError>("DevError")
- .add_property("reason", &PyDevError::get_reason)
- .def_readonly("severity", &Tango::DevError::severity)
- .add_property("desc", &PyDevError::get_desc)
- .add_property("origin", &PyDevError::get_origin)
- ;
-}
+ int get_idl_version();
+
+ virtual void set_timeout_millis(int timeout);
+ virtual int get_timeout_millis();
+ virtual DevSource get_source();
+ virtual void set_source(DevSource );
+ virtual void set_transparency_reconnection(bool val);
+ virtual bool get_transparency_reconnection();
+
+ AccessControlType get_access_control();
+ void set_access_control(AccessControlType acc);
+ AccessControlType get_access_right();
+};
diff --git a/src/sip/constants.sip b/src/sip/constants.sip
new file mode 100644
index 0000000..9a513aa
--- /dev/null
+++ b/src/sip/constants.sip
@@ -0,0 +1,178 @@
+/*******************************************************************************
+
+ 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/>.
+
+*******************************************************************************/
+
+%ModuleHeaderCode
+#include <tango.h>
+using namespace Tango;
+%End
+
+enum CmdArgType {
+ DEV_VOID,
+ DEV_BOOLEAN,
+ DEV_SHORT,
+ DEV_LONG,
+ DEV_FLOAT,
+ DEV_DOUBLE,
+ DEV_USHORT,
+ DEV_ULONG,
+ DEV_STRING,
+ DEVVAR_CHARARRAY,
+ DEVVAR_SHORTARRAY,
+ DEVVAR_LONGARRAY,
+ DEVVAR_FLOATARRAY,
+ DEVVAR_DOUBLEARRAY,
+ DEVVAR_USHORTARRAY,
+ DEVVAR_ULONGARRAY,
+ DEVVAR_STRINGARRAY,
+ DEVVAR_LONGSTRINGARRAY,
+ DEVVAR_DOUBLESTRINGARRAY,
+ DEV_STATE,
+ CONST_DEV_STRING,
+ DEVVAR_BOOLEANARRAY,
+ DEV_UCHAR,
+ DEV_LONG64,
+ DEV_ULONG64,
+ DEVVAR_LONG64ARRAY,
+ DEVVAR_ULONG64ARRAY,
+ DEV_INT,
+ DEV_ENCODED
+};
+
+enum MessBoxType {
+ STOP,
+ INFO
+};
+
+enum PollObjType {
+ POLL_CMD,
+ POLL_ATTR,
+ EVENT_HEARTBEAT,
+ STORE_SUBDEV
+};
+
+enum PollCmdCode {
+ POLL_ADD_OBJ,
+ POLL_REM_OBJ,
+ POLL_START,
+ POLL_STOP,
+ POLL_UPD_PERIOD,
+ POLL_REM_DEV,
+ POLL_EXIT,
+ POLL_REM_EXT_TRIG_OBJ,
+ POLL_ADD_HEARTBEAT,
+ POLL_REM_HEARTBEAT
+};
+
+enum SerialModel {
+ BY_DEVICE,
+ BY_CLASS,
+ BY_PROCESS,
+ NO_SYNC
+};
+
+enum AttReqType {
+ READ_REQ,
+ WRITE_REQ
+};
+
+enum LockCmdCode {
+ LOCK_ADD_DEV,
+ LOCK_REM_DEV,
+ LOCK_UNLOCK_ALL_EXIT,
+ LOCK_EXIT
+};
+
+
+
+enum LogLevel {
+ LOG_OFF,
+ LOG_FATAL,
+ LOG_ERROR,
+ LOG_WARN,
+ LOG_INFO,
+ LOG_DEBUG
+} ;
+
+enum LogTarget {
+ LOG_CONSOLE,
+ LOG_FILE,
+ LOG_DEVICE
+};
+
+enum EventType {
+ CHANGE_EVENT,
+ QUALITY_EVENT,
+ PERIODIC_EVENT,
+ ARCHIVE_EVENT,
+ USER_EVENT,
+ ATTR_CONF_EVENT,
+ DATA_READY_EVENT,
+ numEventType
+};
+
+enum AttrSerialModel
+{
+ ATTR_NO_SYNC,
+ ATTR_BY_KERNEL,
+ ATTR_BY_USER
+};
+
+enum KeepAliveCmdCode
+{
+ EXIT_TH
+};
+
+enum AccessControlType
+{
+ ACCESS_READ,
+ ACCESS_WRITE
+};
+
+enum MinMaxValueCheck
+{
+ MIN,
+ MAX
+};
+
+enum ChannelType
+{
+ ZMQ,
+ NOTIFD
+};
+
+// IDL
+
+enum AttrQuality { ATTR_VALID, ATTR_INVALID, ATTR_ALARM, ATTR_CHANGING, ATTR_WARNING /*, __max_AttrQuality=0xffffffff */ };
+
+enum AttrWriteType { READ, READ_WITH_WRITE, WRITE, READ_WRITE /*, __max_AttrWriteType=0xffffffff */ };
+
+enum AttrDataFormat { SCALAR, SPECTRUM, IMAGE, FMT_UNKNOWN /*, __max_AttrDataFormat=0xffffffff */ };
+
+enum DevSource { DEV, CACHE, CACHE_DEV /*, __max_DevSource=0xffffffff */ };
+
+enum ErrSeverity { WARN, ERR, PANIC /*, __max_ErrSeverity=0xffffffff */ };
+
+enum DevState { ON, OFF, CLOSE, OPEN, INSERT, EXTRACT, MOVING, STANDBY, FAULT, INIT, RUNNING, ALARM, DISABLE, UNKNOWN /*, __max_DevState=0xffffffff */ };
+
+enum DispLevel { OPERATOR, EXPERT /*, __max_DispLevel=0xffffffff */ };
+
diff --git a/src/sip/database.sip b/src/sip/database.sip
new file mode 100644
index 0000000..205ea81
--- /dev/null
+++ b/src/sip/database.sip
@@ -0,0 +1,193 @@
+/*******************************************************************************
+
+ 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/dbdatum.sip b/src/sip/dbdatum.sip
new file mode 100644
index 0000000..0bea30f
--- /dev/null
+++ b/src/sip/dbdatum.sip
@@ -0,0 +1,123 @@
+/*******************************************************************************
+
+ 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/deviceproxy.sip b/src/sip/deviceproxy.sip
new file mode 100644
index 0000000..e6f7543
--- /dev/null
+++ b/src/sip/deviceproxy.sip
@@ -0,0 +1,232 @@
+/*******************************************************************************
+
+ 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 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 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 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 vector<DeviceDataHistory> *command_history(std::string &,int);
+ virtual vector<DeviceDataHistory> *command_history(const char *na,int n)
+ {std::string str(na);return command_history(str,n);}
+
+ virtual vector<DeviceAttributeHistory> *attribute_history(std::string &,int);
+ virtual vector<DeviceAttributeHistory> *attribute_history(const char *na,int n)
+ {std::string str(na);return attribute_history(str,n);}
+//
+// Polling administration methods
+//
+ virtual 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 vector<DeviceAttribute> *read_attributes_reply(long);
+ virtual 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 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 vector<std::string> &filters); // For compatibility with Tango < 8
+ virtual int subscribe_event(const std::string &attr_name, EventType event, CallBack *,
+ const 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 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/stdutils.sip b/src/sip/stdutils.sip
new file mode 100644
index 0000000..aec4e07
--- /dev/null
+++ b/src/sip/stdutils.sip
@@ -0,0 +1,113 @@
+/*******************************************************************************
+
+ 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/>.
+
+*******************************************************************************/
+
+%MappedType std::string
+{
+%TypeHeaderCode
+#include <string>
+%End
+
+%ConvertToTypeCode
+if (sipIsErr == NULL)
+ return PyString_Check(sipPy);
+
+ *sipCppPtr = new std::string(PyString_AsString(sipPy), PyString_Size(sipPy));
+
+ return sipGetState(sipTransferObj);
+%End
+
+%ConvertFromTypeCode
+return PyString_FromStringAndSize(sipCpp->data(),sipCpp->length());
+%End
+
+};
+
+%MappedType std::vector<std::string>
+{
+%TypeHeaderCode
+#include <string>
+#include <vector>
+%End
+
+%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;
+}
+
+*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));
+
+ return sipGetState(sipTransferObj);
+%End
+
+%ConvertFromTypeCode
+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()));
+
+return aReturnListPt;
+%End
+
+};
+
+%MappedType std::vector<int>
+{
+%TypeHeaderCode
+#include <vector>
+%End
+
+%ConvertToTypeCode
+if (sipIsErr == NULL)
+{
+bool aReturnFlag = PyList_Check(sipPy);
+for(int i = 0;aReturnFlag && i < PyList_Size(sipPy);++i)
+ aReturnFlag = PyInt_Check(PyList_GET_ITEM(sipPy,i));
+return aReturnFlag;
+}
+
+*sipCppPtr = new std::vector<int>(PyList_Size(sipPy));
+for(int i = 0;i < PyList_Size(sipPy);++i)
+ (*sipCppPtr)->operator[](i) = PyInt_AS_LONG(PyList_GET_ITEM(sipPy,i));
+
+ return sipGetState(sipTransferObj);
+%End
+
+%ConvertFromTypeCode
+PyObject* aReturnListPt = PyList_New(sipCpp->size());
+std::vector<int>::iterator vIter = sipCpp->begin();
+
+for(int i = 0;vIter != sipCpp->end();++vIter,++i)
+ PyList_SET_ITEM(aReturnListPt,i,PyInt_FromLong(*vIter));
+
+return aReturnListPt;
+%End
+
+};
+
diff --git a/src/pytgutils.cpp b/src/sip/tango.sip
similarity index 85%
rename from src/pytgutils.cpp
rename to src/sip/tango.sip
index 66910eb..25d4a4b 100644
--- a/src/pytgutils.cpp
+++ b/src/sip/tango.sip
@@ -21,9 +21,11 @@
*******************************************************************************/
-#include "precompiled_header.hpp"
-#include "defs.h"
-#include "pytgutils.h"
-
-using namespace boost::python;
+%Module(name=Tango, version=0801)
+%Include stdutils.sip
+%Include constants.sip
+%Include connection.sip
+%Include dbdatum.sip
+%Include database.sip
+%Include deviceproxy.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