Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*----- PROTECTED REGION ID(DataImporterClass.cpp) ENABLED START -----*/
static const char *TagName = "$Name: $";
static const char *CvsPath = "$Source: $";
static const char *SvnPath = "$HeadURL: $";
static const char *HttpServer = "http://www.esrf.eu/computing/cs/tango/tango_doc/ds_doc/";
//=============================================================================
//
// file : DataImporterClass.cpp
//
// description : C++ source for the DataImporterClass.
// A singleton class derived from DeviceClass.
// It implements the command and attribute list
// and all properties and methods required
// by the DataImporter once per process.
//
// project : Data importer
//
// This file is part of Tango device class.
//
// Tango is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Tango 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Tango. If not, see <http://www.gnu.org/licenses/>.
//
// $Author: $
//
// $Revision: $
// $Date: $
//
// $HeadURL: $
//
//=============================================================================
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//=============================================================================
#include <DataImporterClass.h>
/*----- PROTECTED REGION END -----*/ // DataImporterClass.cpp
//-------------------------------------------------------------------
/**
* Create DataImporterClass singleton and
* return it in a C function for Python usage
*/
//-------------------------------------------------------------------
extern "C" {
#ifdef _TG_WINDOWS_
__declspec(dllexport)
#endif
Tango::DeviceClass *_create_DataImporter_class(const char *name) {
return DataImporter_ns::DataImporterClass::init(name);
}
}
namespace DataImporter_ns
{
//===================================================================
// Initialize pointer for singleton pattern
//===================================================================
DataImporterClass *DataImporterClass::_instance = NULL;
//--------------------------------------------------------
/**
* method : DataImporterClass::DataImporterClass(string &s)
* description : constructor for the DataImporterClass
*
* @param s The class name
*/
//--------------------------------------------------------
DataImporterClass::DataImporterClass(string &s):Tango::DeviceClass(s)
{
cout2 << "Entering DataImporterClass constructor" << endl;
set_default_property();
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
write_class_property();
/*----- PROTECTED REGION ID(DataImporterClass::constructor) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // DataImporterClass::constructor
cout2 << "Leaving DataImporterClass constructor" << endl;
}
//--------------------------------------------------------
/**
* method : DataImporterClass::~DataImporterClass()
* description : destructor for the DataImporterClass
*/
//--------------------------------------------------------
DataImporterClass::~DataImporterClass()
{
/*----- PROTECTED REGION ID(DataImporterClass::destructor) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // DataImporterClass::destructor
_instance = NULL;
}
//--------------------------------------------------------
/**
* method : DataImporterClass::init
* description : Create the object if not already done.
* Otherwise, just return a pointer to the object
*
* @param name The class name
*/
//--------------------------------------------------------
DataImporterClass *DataImporterClass::init(const char *name)
{
if (_instance == NULL)
{
try
{
string s(name);
_instance = new DataImporterClass(s);
}
catch (bad_alloc &)
{
throw;
}
}
return _instance;
}
//--------------------------------------------------------
/**
* method : DataImporterClass::instance
* description : Check if object already created,
* and return a pointer to the object
*/
//--------------------------------------------------------
DataImporterClass *DataImporterClass::instance()
{
if (_instance == NULL)
{
cerr << "Class is not initialised !!" << endl;
exit(-1);
}
return _instance;
}
//===================================================================
// Command execution method calls
//===================================================================
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
//--------------------------------------------------------
/**
* method : OnClass::execute()
* description : method to trigger the execution of the command.
*
* @param device The device on which the command must be executed
* @param in_any The command input data
*
* returns The command output data (packed in the Any object)
*/
//--------------------------------------------------------
CORBA::Any *OnClass::execute(Tango::DeviceImpl *device, TANGO_UNUSED(const CORBA::Any &in_any))
{
cout2 << "OnClass::execute(): arrived" << endl;
((static_cast<DataImporter *>(device))->on());
return new CORBA::Any();
}
//--------------------------------------------------------
/**
* method : OffClass::execute()
* description : method to trigger the execution of the command.
*
* @param device The device on which the command must be executed
* @param in_any The command input data
*
* returns The command output data (packed in the Any object)
*/
//--------------------------------------------------------
CORBA::Any *OffClass::execute(Tango::DeviceImpl *device, TANGO_UNUSED(const CORBA::Any &in_any))
{
cout2 << "OffClass::execute(): arrived" << endl;
((static_cast<DataImporter *>(device))->off());
return new CORBA::Any();
}
//===================================================================
// Properties management
//===================================================================
Loading full blame...