File: DataBase.h

package info (click to toggle)
tango 10.0.2%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 89,484 kB
  • sloc: cpp: 201,245; sh: 1,645; python: 953; java: 800; perl: 467; javascript: 447; xml: 325; makefile: 269; sql: 72; ruby: 24
file content (1580 lines) | stat: -rw-r--r-- 60,079 bytes parent folder | download | duplicates (2)
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
87
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
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
/*----- PROTECTED REGION ID(DataBase.h) ENABLED START -----*/
//=============================================================================
//
// file :        DataBase.h
//
// description : Include for the DataBase class.
//
// project :     TANGO Database server.
//
//
// Copyright (C) :      2004,2005,2006,2007,2008,2009,2010,2011,2012,2013
//						European Synchrotron Radiation Facility
//                      BP 220, Grenoble 38043
//                      FRANCE
//
// This file is part of Tango.
//
// 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/>.
//
//=============================================================================
//                This file is generated by POGO
//        (Program Obviously used to Generate tango Object)
//=============================================================================


#ifndef DATABASE_H
#define DATABASE_H

#include "common.h"
#include "DatabaseConnectionPool.h"
#include "DatabaseConnectionHandle.h"

#ifndef  _TG_WINDOWS_
/* Struct to keep in the thread local store the client's address */
struct Value_t : public omni_thread::value_t {
	Value_t(const char *s) : addr(s) {}
	std::string addr;
};

#define MIN_TRANSPORT_STRING_LENGTH 8 /* giop:fd: */
#endif

/*----- PROTECTED REGION END -----*/	//	DataBase.h

/**
 *  DataBase class description:
 *    This class manage the TANGO database.
 */

namespace DataBase_ns
{
/*----- PROTECTED REGION ID(DataBase::Additional Class Declarations) ENABLED START -----*/

		//		Additional Class Declarations
class DummyDev: public Tango::Connection
{
public:
	DummyDev():Tango::Connection(true) {};

	virtual std::string get_corba_name(bool) {std::string str;return str;}
	virtual std::string build_corba_name() {std::string str;return str;}
	virtual int get_lock_ctr() {return 0;}
	virtual void set_lock_ctr(int) {};

	virtual std::string dev_name() {std::string str;return str;}

	int get_env_var(const char *cc,std::string &str_ref) {return Tango::Connection::get_env_var(cc,str_ref);}
};

	/*----- PROTECTED REGION END -----*/	//	DataBase::Additional Class Declarations

class DataBase : public TANGO_BASE_CLASS
{

/*----- PROTECTED REGION ID(DataBase::Data Members) ENABLED START -----*/

	//		Add your own data members
public:
	/**
	 *	current incarnation of database
	 */
	static std::string db_name;

	/**
	 *	Will be set by property of Default object
	 */
	bool	fireToStarter;

	/**
	 *	Database value history depth
	 */
	int	historyDepth;

	/**
	 *	Shared data for update starter thread
	 */
	UpdStarterData	*starter_shared;
	/**
	 *	update starter thread instance
	 */
	UpdateStarter	*upd_starter_thread;

	/*
	 * timing related variables
	 */
	typedef struct timing_stats_struct
	{
		double calls;
		double total_elapsed;
		double average;
		double minimum;
		double maximum;
	} TimingStatsStruct;

	std::map<std::string,TimingStatsStruct*> timing_stats_map;

	int timing_stats_size;
	double *timing_stats_average;
	double *timing_stats_minimum;
	double *timing_stats_maximum;
	double *timing_stats_calls;
	char **timing_stats_index;

	/*
	 * For the DbGetDeviceAttributeProperty2 command
	 */

	typedef struct prop_def
	{
		std::string			prop_name;
		std::string 			prop_name_cd;
		std::vector<std::string>	prop_val;
	} PropDef;

private:
	std::string mysql_db_name{TANGO_DB_NAME};

	/*----- PROTECTED REGION END -----*/	//	DataBase::Data Members


//	Attribute data members
public:
	Tango::DevString	*attr_StoredProcedureRelease_read;
	Tango::DevDouble	*attr_Timing_average_read;
	Tango::DevDouble	*attr_Timing_minimum_read;
	Tango::DevDouble	*attr_Timing_maximum_read;
	Tango::DevDouble	*attr_Timing_calls_read;
	Tango::DevString	*attr_Timing_index_read;
	Tango::DevString	*attr_Timing_info_read;

//	Constructors and destructors
public:
	/**
	 * Constructs a newly device object.
	 *
	 *	@param cl	Class.
	 *	@param s 	Device Name
	 */
	DataBase(Tango::DeviceClass *cl,std::string &s);
	/**
	 * Constructs a newly device object.
	 *
	 *	@param cl	Class.
	 *	@param s 	Device Name
	 */
	DataBase(Tango::DeviceClass *cl,const char *s);
	/**
	 * Constructs a newly device object.
	 *
	 *	@param cl	Class.
	 *	@param s 	Device name
	 *	@param d	Device description.
	 */
	DataBase(Tango::DeviceClass *cl,const char *s,const char *d);
	/**
	 * The device object destructor.
	 */
	~DataBase() {delete_device();};


//	Miscellaneous methods
public:
	/*
	 *	will be called at device destruction or at init command.
	 */
	void delete_device();
	/*
	 *	Initialize the device
	 */
	virtual void init_device();
	/*
	 *	Always executed method before execution command method.
	 */
	virtual void always_executed_hook();


//	Attribute methods
public:
	//--------------------------------------------------------
	/*
	 *	Method      : DataBase::read_attr_hardware()
	 *	Description : Hardware acquisition for attributes.
	 */
	//--------------------------------------------------------
	virtual void read_attr_hardware(std::vector<long> &attr_list);

/**
 *	Attribute StoredProcedureRelease related methods
 *	Description: 
 *
 *	Data type:	Tango::DevString
 *	Attr type:	Scalar
 */
	virtual void read_StoredProcedureRelease(Tango::Attribute &attr);
	virtual bool is_StoredProcedureRelease_allowed(Tango::AttReqType type);
/**
 *	Attribute Timing_average related methods
 *	Description: 
 *
 *	Data type:	Tango::DevDouble
 *	Attr type:	Spectrum max = 64
 */
	virtual void read_Timing_average(Tango::Attribute &attr);
	virtual bool is_Timing_average_allowed(Tango::AttReqType type);
/**
 *	Attribute Timing_minimum related methods
 *	Description: 
 *
 *	Data type:	Tango::DevDouble
 *	Attr type:	Spectrum max = 64
 */
	virtual void read_Timing_minimum(Tango::Attribute &attr);
	virtual bool is_Timing_minimum_allowed(Tango::AttReqType type);
/**
 *	Attribute Timing_maximum related methods
 *	Description: 
 *
 *	Data type:	Tango::DevDouble
 *	Attr type:	Spectrum max = 64
 */
	virtual void read_Timing_maximum(Tango::Attribute &attr);
	virtual bool is_Timing_maximum_allowed(Tango::AttReqType type);
/**
 *	Attribute Timing_calls related methods
 *	Description: 
 *
 *	Data type:	Tango::DevDouble
 *	Attr type:	Spectrum max = 64
 */
	virtual void read_Timing_calls(Tango::Attribute &attr);
	virtual bool is_Timing_calls_allowed(Tango::AttReqType type);
/**
 *	Attribute Timing_index related methods
 *	Description: 
 *
 *	Data type:	Tango::DevString
 *	Attr type:	Spectrum max = 64
 */
	virtual void read_Timing_index(Tango::Attribute &attr);
	virtual bool is_Timing_index_allowed(Tango::AttReqType type);
/**
 *	Attribute Timing_info related methods
 *	Description: 
 *
 *	Data type:	Tango::DevString
 *	Attr type:	Spectrum max = 64
 */
	virtual void read_Timing_info(Tango::Attribute &attr);
	virtual bool is_Timing_info_allowed(Tango::AttReqType type);


	//--------------------------------------------------------
	/**
	 *	Method      : DataBase::add_dynamic_attributes()
	 *	Description : Add dynamic attributes if any.
	 */
	//--------------------------------------------------------
	void add_dynamic_attributes();




//	Command related methods
public:
	/**
	 *	Command State related method
	 *	Description: This command gets the device state (stored in its <i>device_state</i> data member) and returns it to the caller.
	 *
	 *	@returns State Code
	 */
	virtual Tango::DevState dev_state();
	/**
	 *	Command DbAddDevice related method
	 *	Description: Add a Tango class device to a specific device server
	 *
	 *	@param argin Str[0] = Full device server process name
	 *               Str[1] = Device name
	 *               Str[2] = Tango class name
	 */
	virtual void db_add_device(const Tango::DevVarStringArray *argin);
	virtual bool is_DbAddDevice_allowed(const CORBA::Any &any);
	/**
	 *	Command DbAddServer related method
	 *	Description: Create a device server process entry in database
	 *
	 *	@param argin Str[0] = Full device server name
	 *               Str[1] = Device(s) name
	 *               Str[2] = Tango class name
	 *               Str[n] = Device name
	 *               Str[n + 1] = Tango class name
	 */
	virtual void db_add_server(const Tango::DevVarStringArray *argin);
	virtual bool is_DbAddServer_allowed(const CORBA::Any &any);
	/**
	 *	Command DbDeleteAttributeAlias related method
	 *	Description: Delete an attribute alias.
	 *
	 *	@param argin Attriibute alias name.
	 */
	virtual void db_delete_attribute_alias(Tango::DevString argin);
	virtual bool is_DbDeleteAttributeAlias_allowed(const CORBA::Any &any);
	/**
	 *	Command DbDeleteClassAttribute related method
	 *	Description: delete a class attribute and all its properties from database
	 *
	 *	@param argin Str[0] = Tango class name
	 *               Str[1] = Attribute name
	 */
	virtual void db_delete_class_attribute(const Tango::DevVarStringArray *argin);
	virtual bool is_DbDeleteClassAttribute_allowed(const CORBA::Any &any);
	/**
	 *	Command DbDeleteClassAttributeProperty related method
	 *	Description: delete class attribute properties from database
	 *
	 *	@param argin Str[0] = Tango class name
	 *               Str[1] = Attribute name
	 *               Str[2] = Property name
	 *               Str[n] = Property name
	 */
	virtual void db_delete_class_attribute_property(const Tango::DevVarStringArray *argin);
	virtual bool is_DbDeleteClassAttributeProperty_allowed(const CORBA::Any &any);
	/**
	 *	Command DbDeleteClassProperty related method
	 *	Description: Delete class properties from database
	 *
	 *	@param argin Str[0] = Tango class name
	 *               Str[1] = Property name
	 *               Str[n] = Property name
	 */
	virtual void db_delete_class_property(const Tango::DevVarStringArray *argin);
	virtual bool is_DbDeleteClassProperty_allowed(const CORBA::Any &any);
	/**
	 *	Command DbDeleteDevice related method
	 *	Description: Delete a device from database
	 *
	 *	@param argin device name
	 */
	virtual void db_delete_device(Tango::DevString argin);
	virtual bool is_DbDeleteDevice_allowed(const CORBA::Any &any);
	/**
	 *	Command DbDeleteDeviceAlias related method
	 *	Description: Delete a device alias.
	 *
	 *	@param argin device alias name
	 */
	virtual void db_delete_device_alias(Tango::DevString argin);
	virtual bool is_DbDeleteDeviceAlias_allowed(const CORBA::Any &any);
	/**
	 *	Command DbDeleteDeviceAttribute related method
	 *	Description: Delete  device attribute properties from database
	 *
	 *	@param argin Str[0] = Device name
	 *               Str[1] = Attribute name
	 */
	virtual void db_delete_device_attribute(const Tango::DevVarStringArray *argin);
	virtual bool is_DbDeleteDeviceAttribute_allowed(const CORBA::Any &any);
	/**
	 *	Command DbDeleteDeviceAttributeProperty related method
	 *	Description: delete a device attribute property from the database
	 *
	 *	@param argin Str[0] = Device name
	 *               Str[1] = Attribute name
	 *               Str[2] = Property name
	 *               Str[n] = Property name
	 */
	virtual void db_delete_device_attribute_property(const Tango::DevVarStringArray *argin);
	virtual bool is_DbDeleteDeviceAttributeProperty_allowed(const CORBA::Any &any);
	/**
	 *	Command DbDeleteDeviceProperty related method
	 *	Description: Delete device property(ies)
	 *
	 *	@param argin Str[0] = Device name
	 *               Str[1] = Property name
	 *               Str[n] = Property name
	 */
	virtual void db_delete_device_property(const Tango::DevVarStringArray *argin);
	virtual bool is_DbDeleteDeviceProperty_allowed(const CORBA::Any &any);
	/**
	 *	Command DbDeleteProperty related method
	 *	Description: Delete free property from database
	 *
	 *	@param argin Str[0]  = Object name
	 *               Str[1] = Property name
	 *               Str[n] = Property name
	 */
	virtual void db_delete_property(const Tango::DevVarStringArray *argin);
	virtual bool is_DbDeleteProperty_allowed(const CORBA::Any &any);
	/**
	 *	Command DbDeleteServer related method
	 *	Description: Delete server from the database but dont delete device properties
	 *
	 *	@param argin Device server name
	 */
	virtual void db_delete_server(Tango::DevString argin);
	virtual bool is_DbDeleteServer_allowed(const CORBA::Any &any);
	/**
	 *	Command DbDeleteServerInfo related method
	 *	Description: delete info related to a Tango devvice server process
	 *
	 *	@param argin Device server name
	 */
	virtual void db_delete_server_info(Tango::DevString argin);
	virtual bool is_DbDeleteServerInfo_allowed(const CORBA::Any &any);
	/**
	 *	Command DbExportDevice related method
	 *	Description: Export a device to the database
	 *
	 *	@param argin Str[0] = Device name
	 *               Str[1] = CORBA IOR
	 *               Str[2] = Device server process host name
	 *               Str[3] = Device server process PID or string ``null``
	 *               Str[4] = Device server process version
	 */
	virtual void db_export_device(const Tango::DevVarStringArray *argin);
	virtual bool is_DbExportDevice_allowed(const CORBA::Any &any);
	/**
	 *	Command DbExportEvent related method
	 *	Description: Export Event channel to database
	 *
	 *	@param argin Str[0] = event channel name (or factory name)
	 *               Str[1] = CORBA IOR
	 *               Str[2] = Notifd host name
	 *               Str[3] = Notifd pid
	 *               Str[4] = Notifd version
	 */
	virtual void db_export_event(const Tango::DevVarStringArray *argin);
	virtual bool is_DbExportEvent_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetAliasDevice related method
	 *	Description: Get device name from its alias.
	 *
	 *	@param argin Alias name
	 *	@returns Device name
	 */
	virtual Tango::DevString db_get_alias_device(Tango::DevString argin);
	virtual bool is_DbGetAliasDevice_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetAttributeAlias related method
	 *	Description: Get the attribute name for the given alias.
	 *               If alias not found in database, returns an empty string.
	 *
	 *	@param argin The attribute alias name
	 *	@returns The attribute name (device/attribute)
	 */
	virtual Tango::DevString db_get_attribute_alias(Tango::DevString argin);
	virtual bool is_DbGetAttributeAlias_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetAttributeAliasList related method
	 *	Description: Get attribute alias list for a specified filter
	 *
	 *	@param argin attribute alias filter string (eg: att*)
	 *	@returns attribute aliases
	 */
	virtual Tango::DevVarStringArray *db_get_attribute_alias_list(Tango::DevString argin);
	virtual bool is_DbGetAttributeAliasList_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetClassAttributeList related method
	 *	Description: Get attrilute list for a given Tango class with a specified filter
	 *
	 *	@param argin Str[0] = Tango class name
	 *               Str[1] = Attribute name filter (eg: att*)
	 *	@returns Str[0] = Class attribute name
	 *           Str[n] = Class attribute name
	 */
	virtual Tango::DevVarStringArray *db_get_class_attribute_list(const Tango::DevVarStringArray *argin);
	virtual bool is_DbGetClassAttributeList_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetClassAttributeProperty related method
	 *	Description: Get Tango class property(ies) value
	 *
	 *	@param argin Str[0] = Tango class name
	 *               Str[1] = Attribute name
	 *               Str[n] = Attribute name
	 *	@returns Str[0] = Tango class name
	 *           Str[1] = Attribute property  number
	 *           Str[2] = Attribute property 1 name
	 *           Str[3] = Attribute property 1 value
	 *           Str[n + 1] = Attribute property 2 name
	 *           Str[n + 2] = Attribute property 2 value
	 */
	virtual Tango::DevVarStringArray *db_get_class_attribute_property(const Tango::DevVarStringArray *argin);
	virtual bool is_DbGetClassAttributeProperty_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetClassAttributeProperty2 related method
	 *	Description: This command supports array property compared to the old command called
	 *               DbGetClassAttributeProperty. The old command has not been deleted from the
	 *               server for compatibility reasons.
	 *
	 *	@param argin Str[0] = Tango class name
	 *               Str[1] = Attribute name
	 *               Str[n] = Attribute name
	 *	@returns Str[0] = Tango class name
	 *           Str[1] = Attribute property  number
	 *           Str[2] = Attribute property 1 name
	 *           Str[3] = Attribute property 1 value number (array case)
	 *           Str[4] = Attribute property 1 value
	 *           Str[n] = Attribute property 1 value (array case)
	 *           Str[n + 1] = Attribute property 2 name
	 *           Str[n + 2] = Attribute property 2 value number (array case)
	 *           Str[n + 3] = Attribute property 2 value
	 *           Str[n + m] = Attribute property 2 value (array case)
	 */
	virtual Tango::DevVarStringArray *db_get_class_attribute_property2(const Tango::DevVarStringArray *argin);
	virtual bool is_DbGetClassAttributeProperty2_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetClassAttributePropertyHist related method
	 *	Description: Retrieve Tango class attribute property history
	 *
	 *	@param argin Str[0] = Tango class
	 *               Str[1] = Attribute name
	 *               Str[2] = Property name
	 *	@returns Str[0] = Attribute name
	 *           Str[1] = Property name
	 *           Str[2] = date
	 *           Str[3] = Property value number (array case)
	 *           Str[4] = Property value 1
	 *           Str[n] = Property value n
	 */
	virtual Tango::DevVarStringArray *db_get_class_attribute_property_hist(const Tango::DevVarStringArray *argin);
	virtual bool is_DbGetClassAttributePropertyHist_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetClassForDevice related method
	 *	Description: Get Tango class for the specified device.
	 *
	 *	@param argin Device name
	 *	@returns Device Tango class
	 */
	virtual Tango::DevString db_get_class_for_device(Tango::DevString argin);
	virtual bool is_DbGetClassForDevice_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetClassInheritanceForDevice related method
	 *	Description: Get class inheritance for the specified device.
	 *
	 *	@param argin Device name
	 *	@returns Classes off the specified device.
	 *           [0] - is the class of the device.
	 *           [1] - is the class from the device class is inherited.
	 *           ........and so on
	 */
	virtual Tango::DevVarStringArray *db_get_class_inheritance_for_device(Tango::DevString argin);
	virtual bool is_DbGetClassInheritanceForDevice_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetClassList related method
	 *	Description: Get Tango class list with a specified filter
	 *
	 *	@param argin Filter
	 *	@returns Class list
	 */
	virtual Tango::DevVarStringArray *db_get_class_list(Tango::DevString argin);
	virtual bool is_DbGetClassList_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetClassProperty related method
	 *	Description: 
	 *
	 *	@param argin Str[0] = Tango class
	 *               Str[1] = Property name
	 *               Str[2] = Property name
	 *	@returns Str[0] = Tango class
	 *           Str[1] = Property number
	 *           Str[2] = Property name
	 *           Str[3] = Property value number (array case)
	 *           Str[4] = Property value
	 *           Str[n] = Property value (array case)
	 *           ....
	 */
	virtual Tango::DevVarStringArray *db_get_class_property(const Tango::DevVarStringArray *argin);
	virtual bool is_DbGetClassProperty_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetClassPropertyHist related method
	 *	Description: Retrieve Tango class property history
	 *
	 *	@param argin Str[0] = Tango class
	 *               Str[1] = Property name
	 *	@returns Str[0] = Property name
	 *           Str[1] = date
	 *           Str[2] = Property value number (array case)
	 *           Str[3] = Property value 1
	 *           Str[n] = Property value n
	 */
	virtual Tango::DevVarStringArray *db_get_class_property_hist(const Tango::DevVarStringArray *argin);
	virtual bool is_DbGetClassPropertyHist_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetClassPropertyList related method
	 *	Description: Get property list for a given Tango class
	 *
	 *	@param argin The class
	 *	@returns Property name list
	 */
	virtual Tango::DevVarStringArray *db_get_class_property_list(Tango::DevString argin);
	virtual bool is_DbGetClassPropertyList_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetDeviceAlias related method
	 *	Description: Return alias for device name if found.
	 *
	 *	@param argin The device name
	 *	@returns The alias found
	 */
	virtual Tango::DevString db_get_device_alias(Tango::DevString argin);
	virtual bool is_DbGetDeviceAlias_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetDeviceAliasList related method
	 *	Description: Get device alias name with a specific filter
	 *
	 *	@param argin The filter
	 *	@returns Device alias list
	 */
	virtual Tango::DevVarStringArray *db_get_device_alias_list(Tango::DevString argin);
	virtual bool is_DbGetDeviceAliasList_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetDeviceAttributeList related method
	 *	Description: Return list of attributes matching the wildcard
	 *                for the specified device
	 *
	 *	@param argin Str[0] = Device name
	 *               Str[1] = Wildcard
	 *	@returns attribute name list
	 */
	virtual Tango::DevVarStringArray *db_get_device_attribute_list(const Tango::DevVarStringArray *argin);
	virtual bool is_DbGetDeviceAttributeList_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetDeviceAttributeProperty related method
	 *	Description: Get device attribute property(ies) value
	 *
	 *	@param argin Str[0] = Device name
	 *               Str[1] = Attribute name
	 *               Str[n] = Attribute name
	 *	@returns Str[0] = Device name
	 *           Str[1] = Attribute property  number
	 *           Str[2] = Attribute property 1 name
	 *           Str[3] = Attribute property 1 value
	 *           Str[n + 1] = Attribute property 2 name
	 *           Str[n + 2] = Attribute property 2 value
	 */
	virtual Tango::DevVarStringArray *db_get_device_attribute_property(const Tango::DevVarStringArray *argin);
	virtual bool is_DbGetDeviceAttributeProperty_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetDeviceAttributeProperty2 related method
	 *	Description: Retrieve device attribute properties. This command has the possibility to retrieve
	 *               device attribute properties which are arrays. It is not possible with the old
	 *               DbGetDeviceAttributeProperty command. Nevertheless, the old command has not been
	 *               deleted for compatibility reason
	 *
	 *	@param argin Str[0] = Device name
	 *               Str[1] = Attribute name
	 *               Str[n] = Attribute name
	 *	@returns Str[0] = Device name
	 *           Str[1] = Attribute property  number
	 *           Str[2] = Attribute property 1 name
	 *           Str[3] = Attribute property 1 value number (array case)
	 *           Str[4] = Attribute property 1 value
	 *           Str[n] = Attribute property 1 value (array case)
	 *           Str[n + 1] = Attribute property 2 name
	 *           Str[n + 2] = Attribute property 2 value number (array case)
	 *           Str[n + 3] = Attribute property 2 value
	 *           Str[n + m] = Attribute property 2 value (array case)
	 */
	virtual Tango::DevVarStringArray *db_get_device_attribute_property2(const Tango::DevVarStringArray *argin);
	virtual bool is_DbGetDeviceAttributeProperty2_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetDeviceAttributePropertyHist related method
	 *	Description: Retrieve device attribute property history
	 *
	 *	@param argin Str[0] = Device name
	 *               Str[1] = Attribute name
	 *               Str[2] = Property name
	 *	@returns Str[0] = Attribute name
	 *           Str[1] = Property name
	 *           Str[2] = date
	 *           Str[3] = Property value number (array case)
	 *           Str[4] = Property value 1
	 *           Str[n] = Property value n
	 */
	virtual Tango::DevVarStringArray *db_get_device_attribute_property_hist(const Tango::DevVarStringArray *argin);
	virtual bool is_DbGetDeviceAttributePropertyHist_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetDeviceClassList related method
	 *	Description: Get Tango classes/device list embedded in a specific device server
	 *
	 *	@param argin Device server process name
	 *	@returns Str[0] = Device name
	 *           Str[1] = Tango class
	 *           Str[n] = Device name
	 *           Str[n + 1] = Tango class
	 */
	virtual Tango::DevVarStringArray *db_get_device_class_list(Tango::DevString argin);
	virtual bool is_DbGetDeviceClassList_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetDeviceDomainList related method
	 *	Description: Get list of device domain name matching the specified
	 *
	 *	@param argin The wildcard
	 *	@returns Device name domain list
	 */
	virtual Tango::DevVarStringArray *db_get_device_domain_list(Tango::DevString argin);
	virtual bool is_DbGetDeviceDomainList_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetDeviceExportedList related method
	 *	Description: Get a list of exported devices whose names satisfy the filter (wildcard is
	 *
	 *	@param argin filter
	 *	@returns list of exported devices
	 */
	virtual Tango::DevVarStringArray *db_get_device_exported_list(Tango::DevString argin);
	virtual bool is_DbGetDeviceExportedList_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetDeviceFamilyList related method
	 *	Description: Get a list of device name families for device name matching the
	 *               specified wildcard
	 *
	 *	@param argin The wildcard
	 *	@returns Family list
	 */
	virtual Tango::DevVarStringArray *db_get_device_family_list(Tango::DevString argin);
	virtual bool is_DbGetDeviceFamilyList_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetDeviceInfo related method
	 *	Description: Returns info from DbImportDevice and started/stopped dates.
	 *
	 *	@param argin Device name
	 *	@returns Str[0] = Device name
	 *           Str[1] = CORBA IOR
	 *           Str[2] = Device version
	 *           Str[3] = Device Server name
	 *           Str[4] = Device Server process host name
	 *           Str[5] = Started date (or ? if not set)
	 *           Str[6] = Stopped date (or ? if not set)
	 *           Str[7] = Device class
	 *           
	 *           Lg[0] = Device exported flag
	 *           Lg[1] = Device Server process PID (or -1 if not set)
	 */
	virtual Tango::DevVarLongStringArray *db_get_device_info(Tango::DevString argin);
	virtual bool is_DbGetDeviceInfo_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetDeviceList related method
	 *	Description: Get a list of devices for specified server and class.
	 *
	 *	@param argin argin[0] : server name
	 *               argin[1] : class name
	 *	@returns The list of devices for specified server and class.
	 */
	virtual Tango::DevVarStringArray *db_get_device_list(const Tango::DevVarStringArray *argin);
	virtual bool is_DbGetDeviceList_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetDeviceWideList related method
	 *	Description: Get a list of devices whose names satisfy the filter.
	 *
	 *	@param argin filter
	 *	@returns list of exported devices
	 */
	virtual Tango::DevVarStringArray *db_get_device_wide_list(Tango::DevString argin);
	virtual bool is_DbGetDeviceWideList_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetDeviceMemberList related method
	 *	Description: Get a list of device name members for device name matching the
	 *               specified filter
	 *
	 *	@param argin The filter
	 *	@returns Device names member list
	 */
	virtual Tango::DevVarStringArray *db_get_device_member_list(Tango::DevString argin);
	virtual bool is_DbGetDeviceMemberList_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetDeviceProperty related method
	 *	Description: 
	 *
	 *	@param argin Str[0] = Device name
	 *               Str[1] = Property name
	 *               Str[n] = Property name
	 *	@returns Str[0] = Device name
	 *           Str[1] = Property number
	 *           Str[2] = Property name
	 *           Str[3] = Property value number (array case)
	 *           Str[4] = Property value 1
	 *           Str[n] = Property value n (array case)
	 *           Str[n + 1] = Property name
	 *           Str[n + 2] = Property value number (array case)
	 *           Str[n + 3] = Property value 1
	 *           Str[n + m] = Property value m
	 */
	virtual Tango::DevVarStringArray *db_get_device_property(const Tango::DevVarStringArray *argin);
	virtual bool is_DbGetDeviceProperty_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetDevicePropertyHist related method
	 *	Description: Retrieve device  property history
	 *
	 *	@param argin Str[0] = Device name
	 *               Str[2] = Property name
	 *	@returns Str[0] = Property name
	 *           Str[1] = date
	 *           Str[2] = Property value number (array case)
	 *           Str[3] = Property value 1
	 *           Str[n] = Property value n
	 */
	virtual Tango::DevVarStringArray *db_get_device_property_hist(const Tango::DevVarStringArray *argin);
	virtual bool is_DbGetDevicePropertyHist_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetDevicePropertyList related method
	 *	Description: Get property list belonging to the specified device and with
	 *               name matching the specified filter
	 *
	 *	@param argin Str[0] = device name
	 *               Str[1] = Filter
	 *	@returns Property name list
	 */
	virtual Tango::DevVarStringArray *db_get_device_property_list(const Tango::DevVarStringArray *argin);
	virtual bool is_DbGetDevicePropertyList_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetDeviceServerClassList related method
	 *	Description: Get list of Tango classes for a device server
	 *
	 *	@param argin device server process name
	 *	@returns list of classes for this device server
	 */
	virtual Tango::DevVarStringArray *db_get_device_server_class_list(Tango::DevString argin);
	virtual bool is_DbGetDeviceServerClassList_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetExportdDeviceListForClass related method
	 *	Description: Query the database for device exported for the specified class.
	 *
	 *	@param argin Class name
	 *	@returns Device exported list
	 */
	virtual Tango::DevVarStringArray *db_get_exportd_device_list_for_class(Tango::DevString argin);
	virtual bool is_DbGetExportdDeviceListForClass_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetHostList related method
	 *	Description: Get host list with name matching the specified filter
	 *
	 *	@param argin The filter
	 *	@returns Host name list
	 */
	virtual Tango::DevVarStringArray *db_get_host_list(Tango::DevString argin);
	virtual bool is_DbGetHostList_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetHostServerList related method
	 *	Description: Get list of device server process name running on host with name matching
	 *               the specified filter
	 *
	 *	@param argin The filter
	 *	@returns Device server process name list
	 */
	virtual Tango::DevVarStringArray *db_get_host_server_list(Tango::DevString argin);
	virtual bool is_DbGetHostServerList_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetHostServersInfo related method
	 *	Description: Get info about all servers running on specified host, name, mode and level
	 *
	 *	@param argin Host name
	 *	@returns Server info for all servers running on specified host
	 */
	virtual Tango::DevVarStringArray *db_get_host_servers_info(Tango::DevString argin);
	virtual bool is_DbGetHostServersInfo_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetInstanceNameList related method
	 *	Description: Returns the instance names found for specified server.
	 *
	 *	@param argin Server name
	 *	@returns The instance names found for specified server.
	 */
	virtual Tango::DevVarStringArray *db_get_instance_name_list(Tango::DevString argin);
	virtual bool is_DbGetInstanceNameList_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetObjectList related method
	 *	Description: Get list of free object defined in database with name
	 *               matching the specified filter
	 *
	 *	@param argin The filter
	 *	@returns Object name list
	 */
	virtual Tango::DevVarStringArray *db_get_object_list(Tango::DevString argin);
	virtual bool is_DbGetObjectList_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetProperty related method
	 *	Description: Get free object property
	 *
	 *	@param argin Str[0] = Object name
	 *               Str[1] = Property name
	 *               Str[n] = Property name
	 *	@returns Str[0] = Object name
	 *           Str[1] = Property number
	 *           Str[2] = Property name
	 *           Str[3] = Property value number (array case)
	 *           Str[4] = Property value 1
	 *           Str[n] = Property value n (array case)
	 *           Str[n + 1] = Property name
	 *           Str[n + 2] = Property value number (array case)
	 *           Str[n + 3] = Property value 1
	 *           Str[n + m] = Property value m
	 */
	virtual Tango::DevVarStringArray *db_get_property(const Tango::DevVarStringArray *argin);
	virtual bool is_DbGetProperty_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetPropertyHist related method
	 *	Description: Retrieve object  property history
	 *
	 *	@param argin Str[0] = Object name
	 *               Str[2] = Property name
	 *	@returns Str[0] = Property name
	 *           Str[1] = date
	 *           Str[2] = Property value number (array case)
	 *           Str[3] = Property value 1
	 *           Str[n] = Property value n
	 */
	virtual Tango::DevVarStringArray *db_get_property_hist(const Tango::DevVarStringArray *argin);
	virtual bool is_DbGetPropertyHist_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetPropertyList related method
	 *	Description: Get list of property defined for a free object and matching the
	 *               specified filter
	 *
	 *	@param argin Str[0] = Object name
	 *               Str[1] = filter
	 *	@returns Property name list
	 */
	virtual Tango::DevVarStringArray *db_get_property_list(const Tango::DevVarStringArray *argin);
	virtual bool is_DbGetPropertyList_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetServerInfo related method
	 *	Description: Get info about host, mode and level for specified server
	 *
	 *	@param argin server name
	 *	@returns server info
	 */
	virtual Tango::DevVarStringArray *db_get_server_info(Tango::DevString argin);
	virtual bool is_DbGetServerInfo_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetServerList related method
	 *	Description: Get list of device server process defined in database
	 *               with name matching the specified filter
	 *
	 *	@param argin The filter
	 *	@returns Device server process name list
	 */
	virtual Tango::DevVarStringArray *db_get_server_list(Tango::DevString argin);
	virtual bool is_DbGetServerList_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetServerNameList related method
	 *	Description: Returns the list of server names found for the wildcard specified.
	 *               It returns only the server executable name without instance name as DbGetServerList.
	 *
	 *	@param argin wildcard for server names.
	 *	@returns server names found.
	 */
	virtual Tango::DevVarStringArray *db_get_server_name_list(Tango::DevString argin);
	virtual bool is_DbGetServerNameList_allowed(const CORBA::Any &any);
	/**
	 *	Command DbImportDevice related method
	 *	Description: Import a device from the database
	 *
	 *	@param argin Device name (or alias)
	 *	@returns Str[0] = device name
	 *           Str[1] = CORBA IOR
	 *           Str[2] = device version
	 *           Str[3] = device server process name
	 *           Str[4] = host name
	 *           Str[5] = Tango class name
	 *           
	 *           Lg[0] = Exported flag
	 *           Lg[1] = Device server process PID
	 */
	virtual Tango::DevVarLongStringArray *db_import_device(Tango::DevString argin);
	virtual bool is_DbImportDevice_allowed(const CORBA::Any &any);
	/**
	 *	Command DbImportEvent related method
	 *	Description: Get event channel info from database
	 *
	 *	@param argin name of event channel or factory
	 *	@returns export information e.g. IOR
	 */
	virtual Tango::DevVarLongStringArray *db_import_event(Tango::DevString argin);
	virtual bool is_DbImportEvent_allowed(const CORBA::Any &any);
	/**
	 *	Command DbInfo related method
	 *	Description: Get miscellaneous numbers on information
	 *               stored in database
	 *
	 *	@returns Miscellaneous info like:
	 *           - Device defined in database
	 *           - Device marked as exported in database
	 *           - Device server process defined in database
	 *           - Device server process marked as exported in database
	 *           - Device properties defined in database
	 *           - Class properties defined in database
	 *           - Device attribute properties defined in database
	 *           - Class attribute properties defined in database
	 *           - Object properties defined in database
	 */
	virtual Tango::DevVarStringArray *db_info();
	virtual bool is_DbInfo_allowed(const CORBA::Any &any);
	/**
	 *	Command DbPutAttributeAlias related method
	 *	Description: Define an alias for an attribute
	 *
	 *	@param argin Str[0] = attribute name
	 *               Str[1] = attribute alias
	 */
	virtual void db_put_attribute_alias(const Tango::DevVarStringArray *argin);
	virtual bool is_DbPutAttributeAlias_allowed(const CORBA::Any &any);
	/**
	 *	Command DbPutClassAttributeProperty related method
	 *	Description: Create/Update class attribute property(ies) in database
	 *
	 *	@param argin Str[0] = Tango class name
	 *               Str[1] = Attribute number
	 *               Str[2] = Attribute name
	 *               Str[3] = Property number
	 *               Str[4] = Property name
	 *               Str[5] = Property value
	 *               .....
	 */
	virtual void db_put_class_attribute_property(const Tango::DevVarStringArray *argin);
	virtual bool is_DbPutClassAttributeProperty_allowed(const CORBA::Any &any);
	/**
	 *	Command DbPutClassAttributeProperty2 related method
	 *	Description: This command adds support for array properties compared to the previous one
	 *               called DbPutClassAttributeProperty. The old comman is still there for compatibility reason
	 *
	 *	@param argin Str[0] = Tango class name
	 *               Str[1] = Attribute number
	 *               Str[2] = Attribute name
	 *               Str[3] = Property number
	 *               Str[4] = Property name
	 *               Str[5] = Property value number (array case)
	 *               Str[5] = Property value 1
	 *               Str[n] = Property value n (array case)
	 *               .....
	 */
	virtual void db_put_class_attribute_property2(const Tango::DevVarStringArray *argin);
	virtual bool is_DbPutClassAttributeProperty2_allowed(const CORBA::Any &any);
	/**
	 *	Command DbPutClassProperty related method
	 *	Description: Create / Update class property(ies)
	 *
	 *	@param argin Str[0] = Tango class name
	 *               Str[1] = Property number
	 *               Str[2] = Property name
	 *               Str[3] = Property value number
	 *               Str[4] = Property value 1
	 *               Str[n] = Property value n
	 *               ....
	 */
	virtual void db_put_class_property(const Tango::DevVarStringArray *argin);
	virtual bool is_DbPutClassProperty_allowed(const CORBA::Any &any);
	/**
	 *	Command DbPutDeviceAlias related method
	 *	Description: Define alias for  a given device name
	 *
	 *	@param argin Str[0] = device name
	 *               Str[1] = alias name
	 */
	virtual void db_put_device_alias(const Tango::DevVarStringArray *argin);
	virtual bool is_DbPutDeviceAlias_allowed(const CORBA::Any &any);
	/**
	 *	Command DbPutDeviceAttributeProperty related method
	 *	Description: Create/Update device attribute property(ies) in database
	 *
	 *	@param argin Str[0] = Device name
	 *               Str[1] = Attribute number
	 *               Str[2] = Attribute name
	 *               Str[3] = Property number
	 *               Str[4] = Property name
	 *               Str[5] = Property value
	 *               .....
	 */
	virtual void db_put_device_attribute_property(const Tango::DevVarStringArray *argin);
	virtual bool is_DbPutDeviceAttributeProperty_allowed(const CORBA::Any &any);
	/**
	 *	Command DbPutDeviceAttributeProperty2 related method
	 *	Description: Put device attribute property. This command adds the possibility to have attribute property
	 *               which are arrays. Not possible with the old DbPutDeviceAttributeProperty command.
	 *               This old command is not deleted for compatibility reasons.
	 *
	 *	@param argin Str[0] = Device name
	 *               Str[1] = Attribute number
	 *               Str[2] = Attribute name
	 *               Str[3] = Property number
	 *               Str[4] = Property name
	 *               Str[5] = Property value number (array case)
	 *               Str[5] = Property value 1
	 *               Str[n] = Property value n (array case)
	 *               .....
	 */
	virtual void db_put_device_attribute_property2(const Tango::DevVarStringArray *argin);
	virtual bool is_DbPutDeviceAttributeProperty2_allowed(const CORBA::Any &any);
	/**
	 *	Command DbPutDeviceProperty related method
	 *	Description: Create / Update device property(ies)
	 *
	 *	@param argin Str[0] = Tango device name
	 *               Str[1] = Property number
	 *               Str[2] = Property name
	 *               Str[3] = Property value number
	 *               Str[4] = Property value 1
	 *               Str[n] = Property value n
	 *               ....
	 */
	virtual void db_put_device_property(const Tango::DevVarStringArray *argin);
	virtual bool is_DbPutDeviceProperty_allowed(const CORBA::Any &any);
	/**
	 *	Command DbPutProperty related method
	 *	Description: Create / Update free object property(ies)
	 *
	 *	@param argin Str[0] = Object name
	 *               Str[1] = Property number
	 *               Str[2] = Property name
	 *               Str[3] = Property value number
	 *               Str[4] = Property value 1
	 *               Str[n] = Property value n
	 *               ....
	 */
	virtual void db_put_property(const Tango::DevVarStringArray *argin);
	virtual bool is_DbPutProperty_allowed(const CORBA::Any &any);
	/**
	 *	Command DbPutServerInfo related method
	 *	Description: Update server info including host, mode and level
	 *
	 *	@param argin server info
	 */
	virtual void db_put_server_info(const Tango::DevVarStringArray *argin);
	virtual bool is_DbPutServerInfo_allowed(const CORBA::Any &any);
	/**
	 *	Command DbUnExportDevice related method
	 *	Description: Mark a device as non exported in database
	 *
	 *	@param argin Device name
	 */
	virtual void db_un_export_device(Tango::DevString argin);
	virtual bool is_DbUnExportDevice_allowed(const CORBA::Any &any);
	/**
	 *	Command DbUnExportEvent related method
	 *	Description: Mark one event channel as non exported in database
	 *
	 *	@param argin name of event channel or factory to unexport
	 */
	virtual void db_un_export_event(Tango::DevString argin);
	virtual bool is_DbUnExportEvent_allowed(const CORBA::Any &any);
	/**
	 *	Command DbUnExportServer related method
	 *	Description: Mark all devices belonging to a specified device server
	 *               process as non exported
	 *
	 *	@param argin Device server name (executable/instance)
	 */
	virtual void db_un_export_server(Tango::DevString argin);
	virtual bool is_DbUnExportServer_allowed(const CORBA::Any &any);
	/**
	 *	Command ResetTimingValues related method
	 *	Description: Reset the timing attribute values.
	 *
	 */
	virtual void reset_timing_values();
	virtual bool is_ResetTimingValues_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetDataForServerCache related method
	 *	Description: This command returns all the data needed by a device server process during its
	 *               startup sequence. The aim of this command is to minimize database access during
	 *               device server startup sequence.
	 *
	 *	@param argin Elt[0] = DS name (exec_name/inst_name), Elt[1] = Host name
	 *	@returns All the data needed by the device server during its startup sequence. Precise list depend on the device server
	 */
	virtual Tango::DevVarStringArray *db_get_data_for_server_cache(const Tango::DevVarStringArray *argin);
	virtual bool is_DbGetDataForServerCache_allowed(const CORBA::Any &any);
	/**
	 *	Command DbDeleteAllDeviceAttributeProperty related method
	 *	Description: Delete all attribute properties for the specified device attribute(s)
	 *
	 *	@param argin str[0] = device name
	 *               Str[1]...str[n] = attribute name(s)
	 */
	virtual void db_delete_all_device_attribute_property(const Tango::DevVarStringArray *argin);
	virtual bool is_DbDeleteAllDeviceAttributeProperty_allowed(const CORBA::Any &any);
	/**
	 *	Command DbMySqlSelect related method
	 *	Description: This is a very low level command.
	 *               It executes the specified  SELECT command on TANGO database and returns its result without filter.
	 *
	 *	@param argin MySql Select command
	 *	@returns MySql Select command result
	 *            - svalues : select results
	 *            - lvalue[n] : =0 if svalue[n] is null else =1
	 *            (last lvalue -1) is number of rows, (last lvalue) is number of fields
	 */
	virtual Tango::DevVarLongStringArray *db_my_sql_select(Tango::DevString argin);
	virtual bool is_DbMySqlSelect_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetCSDbServerList related method
	 *	Description: Get a list of host:port for all database server defined in the control system
	 *
	 *	@returns List of host:port with one element for each database server
	 */
	virtual Tango::DevVarStringArray *db_get_csdb_server_list();
	virtual bool is_DbGetCSDbServerList_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetAttributeAlias2 related method
	 *	Description: Get the attribute alias from the attribute name.
	 *               Returns one empty string if nothing found in database
	 *
	 *	@param argin The attribute name (dev_name/att_name)
	 *	@returns The attribute alias name (or empty string)
	 */
	virtual Tango::DevString db_get_attribute_alias2(Tango::DevString argin);
	virtual bool is_DbGetAttributeAlias2_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetAliasAttribute related method
	 *	Description: Get the attribute name from the given alias.
	 *               If the given alias is not found in database, returns an empty string
	 *
	 *	@param argin The attribute alias
	 *	@returns The attribute name (dev_name/att_name)
	 */
	virtual Tango::DevString db_get_alias_attribute(Tango::DevString argin);
	virtual bool is_DbGetAliasAttribute_allowed(const CORBA::Any &any);
	/**
	 *	Command DbRenameServer related method
	 *	Description: Rename a device server process
	 *
	 *	@param argin s[0] = old device server name (exec/instance)
	 *               s[1] = new device server name (exec/instance)
	 */
	virtual void db_rename_server(const Tango::DevVarStringArray *argin);
	virtual bool is_DbRenameServer_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetClassPipeProperty related method
	 *	Description: Retrieve class pipe properties
	 *
	 *	@param argin Str[0] = Tango class name
	 *               Str[1] = Pipe name
	 *               Str[n] = Pipe name
	 *	@returns Str[0] = Tango class name
	 *           Str[1] = Pipe property  number
	 *           Str[2] = Pipe property 1 name
	 *           Str[3] = Pipe property 1 value number (array case)
	 *           Str[4] = Pipe property 1 value
	 *           Str[n] = Pipe property 1 value (array case)
	 *           Str[n + 1] = Pipe property 2 name
	 *           Str[n + 2] = Pipe property 2 value number (array case)
	 *           Str[n + 3] = Pipe property 2 value
	 *           Str[n + m] = Pipe property 2 value (array case)
	 */
	virtual Tango::DevVarStringArray *db_get_class_pipe_property(const Tango::DevVarStringArray *argin);
	virtual bool is_DbGetClassPipeProperty_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetDevicePipeProperty related method
	 *	Description: Retrieve device pipe properties
	 *
	 *	@param argin Str[0] = Device name
	 *               Str[1] = Pipe name
	 *               Str[n] = Pipe name
	 *	@returns Str[0] = Device name
	 *           Str[1] = Pipe property  number
	 *           Str[2] = Pipe property 1 name
	 *           Str[3] = Pipe property 1 value number (array case)
	 *           Str[4] = Pipe property 1 value
	 *           Str[n] = Pipe property 1 value (array case)
	 *           Str[n + 1] = Pipe property 2 name
	 *           Str[n + 2] = Pipe property 2 value number (array case)
	 *           Str[n + 3] = Pipe property 2 value
	 *           Str[n + m] = Pipe property 2 value (array case)
	 */
	virtual Tango::DevVarStringArray *db_get_device_pipe_property(const Tango::DevVarStringArray *argin);
	virtual bool is_DbGetDevicePipeProperty_allowed(const CORBA::Any &any);
	/**
	 *	Command DbDeleteClassPipe related method
	 *	Description: Delete a class pipe and all its properties from database
	 *
	 *	@param argin Str[0] = Tango class name
	 *               Str[1] = Pipe name
	 */
	virtual void db_delete_class_pipe(const Tango::DevVarStringArray *argin);
	virtual bool is_DbDeleteClassPipe_allowed(const CORBA::Any &any);
	/**
	 *	Command DbDeleteDevicePipe related method
	 *	Description: Delete device pipe properties from database
	 *
	 *	@param argin Str[0] = Device name
	 *               Str[1] = Pipe name
	 */
	virtual void db_delete_device_pipe(const Tango::DevVarStringArray *argin);
	virtual bool is_DbDeleteDevicePipe_allowed(const CORBA::Any &any);
	/**
	 *	Command DbDeleteClassPipeProperty related method
	 *	Description: Delete class pipe properties from database
	 *
	 *	@param argin Str[0] = Tango class name
	 *               Str[1] = Pipe name
	 *               Str[2] = Property name
	 *               Str[n] = Property name
	 */
	virtual void db_delete_class_pipe_property(const Tango::DevVarStringArray *argin);
	virtual bool is_DbDeleteClassPipeProperty_allowed(const CORBA::Any &any);
	/**
	 *	Command DbDeleteDevicePipeProperty related method
	 *	Description: Delete device pipe properties from database
	 *
	 *	@param argin Str[0] = Device name
	 *               Str[1] = Pipe name
	 *               Str[2] = Property name
	 *               Str[n] = Property name
	 */
	virtual void db_delete_device_pipe_property(const Tango::DevVarStringArray *argin);
	virtual bool is_DbDeleteDevicePipeProperty_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetClassPipeList related method
	 *	Description: Get pipe list for a given Tango class with a specified filter
	 *
	 *	@param argin Str[0] = Tango class name
	 *               Str[1] = Pipe name filter (eg: pip*)
	 *	@returns Str[0] = Class pipe name
	 *           Str[n] = Class pipe name
	 */
	virtual Tango::DevVarStringArray *db_get_class_pipe_list(const Tango::DevVarStringArray *argin);
	virtual bool is_DbGetClassPipeList_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetDevicePipeList related method
	 *	Description: Return list of pipes matching the wildcard for the specified device
	 *
	 *	@param argin Str[0] = Device name
	 *               Str[1] = Wildcard
	 *	@returns Pipe name list
	 */
	virtual Tango::DevVarStringArray *db_get_device_pipe_list(const Tango::DevVarStringArray *argin);
	virtual bool is_DbGetDevicePipeList_allowed(const CORBA::Any &any);
	/**
	 *	Command DbDeleteAllDevicePipeProperty related method
	 *	Description: Delete all pipe properties for the specified device pipe(s)
	 *
	 *	@param argin str[0] = device name
	 *               Str[1]...str[n] = pipe name(s)
	 */
	virtual void db_delete_all_device_pipe_property(const Tango::DevVarStringArray *argin);
	virtual bool is_DbDeleteAllDevicePipeProperty_allowed(const CORBA::Any &any);
	/**
	 *	Command DbPutClassPipeProperty related method
	 *	Description: Create/Update class pipe property(ies) in database
	 *
	 *	@param argin Str[0] = Tango class name
	 *               Str[1] = Pipe number
	 *               Str[2] = Pipe name
	 *               Str[3] = Property number
	 *               Str[4] = Property name
	 *               Str[5] = Property value number (array case)
	 *               Str[5] = Property value 1
	 *               Str[n] = Property value n (array case)
	 */
	virtual void db_put_class_pipe_property(const Tango::DevVarStringArray *argin);
	virtual bool is_DbPutClassPipeProperty_allowed(const CORBA::Any &any);
	/**
	 *	Command DbPutDevicePipeProperty related method
	 *	Description: Create/Update device pipe property(ies) in database
	 *
	 *	@param argin Str[0] = Device name
	 *               Str[1] = Pipe number
	 *               Str[2] = Pipe name
	 *               Str[3] = Property number
	 *               Str[4] = Property name
	 *               Str[5] = Property value number (array case)
	 *               Str[6] = Property value 1
	 *               Str[n] = Property value n (array case)
	 */
	virtual void db_put_device_pipe_property(const Tango::DevVarStringArray *argin);
	virtual bool is_DbPutDevicePipeProperty_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetClassPipePropertyHist related method
	 *	Description: Retrieve Tango class pipe property history
	 *
	 *	@param argin Str[0] = Tango class
	 *               Str[1] = Pipe name
	 *               Str[2] = Property name
	 *	@returns Str[0] = Pipe name
	 *           Str[1] = Property name
	 *           Str[2] = date
	 *           Str[3] = Property value number (array case)
	 *           Str[4] = Property value 1
	 *           Str[n] = Property value n
	 */
	virtual Tango::DevVarStringArray *db_get_class_pipe_property_hist(const Tango::DevVarStringArray *argin);
	virtual bool is_DbGetClassPipePropertyHist_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetDevicePipePropertyHist related method
	 *	Description: Retrieve device pipe property history
	 *
	 *	@param argin Str[0] = Device name
	 *               Str[1] = Pipe name
	 *               Str[2] = Property name
	 *	@returns Str[0] = Pipe name
	 *           Str[1] = Property name
	 *           Str[2] = date
	 *           Str[3] = Property value number (array case)
	 *           Str[4] = Property value 1
	 *           Str[n] = Property value n
	 */
	virtual Tango::DevVarStringArray *db_get_device_pipe_property_hist(const Tango::DevVarStringArray *argin);
	virtual bool is_DbGetDevicePipePropertyHist_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetForwardedAttributeListForDevice related method
	 *	Description: Get the list of devices using forwarded attribute(s) from specified device
	 *
	 *	@param argin The specified device name
	 *	@returns argout[n]     : device name
	 *           argout[n+1] :the forwardef attribute
	 *           argout[n+2] :the root attribute (__root_att)
	 */
	virtual Tango::DevVarStringArray *db_get_forwarded_attribute_list_for_device(Tango::DevString argin);
	virtual bool is_DbGetForwardedAttributeListForDevice_allowed(const CORBA::Any &any);
	/**
	 *	Command DbGetClassPropertyListWildcard related method
	 *	Description: Get property list belonging to the specified class and with
	 *               name matching the specified filter
	 *
	 *	@param argin Str[0] = class name
	 *               Str[1] = Filter
	 *	@returns Property name list
	 */
	virtual Tango::DevVarStringArray *db_get_class_property_list_wildcard(const Tango::DevVarStringArray *argin);
	virtual bool is_DbGetClassPropertyListWildcard_allowed(const CORBA::Any &any);


	//--------------------------------------------------------
	/**
	 *	Method      : DataBase::add_dynamic_commands()
	 *	Description : Add dynamic commands if any.
	 */
	//--------------------------------------------------------
	void add_dynamic_commands();

/*----- PROTECTED REGION ID(DataBase::Additional Method prototypes) ENABLED START -----*/

	//	Additional Method prototypes
protected :
	bool check_device_name(std::string &);
	bool device_name_to_dfm(std::string &device_name, char domain[], char family[], char member[]);
	std::string replace_wildcard(const char*);
	Tango::DevString db_get_device_host(Tango::DevString, DatabaseConnectionHandle &dch);
  Tango::DevString db_get_device_host(Tango::DevString argin);
	std::string escape_string(const char *string_c_str);
	void init_timing_stats();
	Tango::DevULong64 get_id(const char *name, DatabaseConnectionHandle &dch);
	void check_history_tables();
	void purge_property(const char *table,const char *field,const char *object,const char *name,DatabaseConnectionHandle &dch);
	void purge_att_property(const char *table,const char *field,const char *object,const char *attribute,const char *name,DatabaseConnectionHandle &dch);
	void purge_pipe_property(const char *table,const char *field,const char *object,const char *pipe,const char *name,DatabaseConnectionHandle &dch);

	char 			*stored_release_ptr;
	char			stored_release[128];

	std::string			ho;
	char			ho_name[1024];

	omni_mutex		timing_stats_mutex;
	omni_mutex		starter_mutex;

	bool host_port_from_ior(const char *,std::string &);
    void create_update_mem_att(const Tango::DevVarStringArray *);

	inline void update_timing_stats(TimeVal before, TimeVal after, std::string command)
	{
		double time_elapsed = Elapsed(before, after);
		timing_stats_mutex.lock();
		TimingStatsStruct *timing_stats = timing_stats_map[command];
		if (timing_stats != NULL)
		{
			timing_stats->calls++;
			timing_stats->total_elapsed = timing_stats->total_elapsed+time_elapsed;
			timing_stats->average = timing_stats->total_elapsed/timing_stats->calls;
			if (time_elapsed > timing_stats->maximum) timing_stats->maximum = time_elapsed;
			if (time_elapsed < timing_stats->minimum || timing_stats->minimum == 0.0) timing_stats->minimum = time_elapsed;
		}
		timing_stats_mutex.unlock();
	}

#ifdef WIN32
	inline static void w_gettimeofday(LARGE_INTEGER *t)
	{
		static int				status = 0;
		if (status==0)
			//	Initialize
			status = QueryPerformanceFrequency(&cpu_freq);

		if (status!=0)
			QueryPerformanceCounter(t);		//	Get micro-second time
		else
			t->QuadPart = 0;
	}
#endif

public:

	void simple_query(std::string sql_query,const char *method);
	void simple_query(std::string sql_query,const char *method, DatabaseConnectionHandle& dch);
	MYSQL_RES *query(std::string sql_query,const char *method);
	MYSQL_RES *query(std::string sql_query,const char *method, DatabaseConnectionHandle& dch);

	// TODO make private
	DatabaseConnectionPoolPtr dcp;

private:
	void check_authorization();

private:
  template<typename T>
  T ParseString(const char * c_str);

	/*----- PROTECTED REGION END -----*/	//	DataBase::Additional Method prototypes
};

/*----- PROTECTED REGION ID(DataBase::Additional Classes Definitions) ENABLED START -----*/

template<>
int DataBase::ParseString<int>(const char * c_str);

	//	Additional Classes definitions
class AutoLock
{
public:
	AutoLock(DataBase *);
	~AutoLock();

	DatabaseConnectionHandle& get_dch() {return m_dch;};

private:
	DataBase        *the_db;
	DatabaseConnectionHandle m_dch;
};

class DbInter: public Tango::Interceptors
{
public:
	DbInter() {}
	~DbInter() {}

	virtual void create_thread()
	{
		if (Tango::Util::instance()->is_svr_starting() == false)
			mysql_thread_init();
	}
	virtual void delete_thread()
	{
		if (Tango::Util::instance()->is_svr_starting() == false)
			mysql_thread_end();
	}
};

	/*----- PROTECTED REGION END -----*/	//	DataBase::Additional Classes Definitions

}	//	End of namespace

#endif   //	DataBase_H