VirtualInstrumentManager.hh
1.51 KB
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
/*
* VirtualInstrumentManager.hh
*
* Created on: Jan 17, 2013
* Author: f.casimir
*/
#ifndef VIRTUALINSTRUMENTMANAGER_HH_
#define VIRTUALINSTRUMENTMANAGER_HH_
#include <string>
#include <map>
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
#include "dsgpatt_Singleton.hh"
namespace AMDA {
namespace DDServerInterface {
class VirtualInstrument;
typedef boost::weak_ptr<VirtualInstrument> VirtualInstrumentWPtr;
typedef boost::shared_ptr<VirtualInstrument> VirtualInstrumentSPtr;
/**
* @class VirtualInstrumentManager
* @brief This Singleton contains and maintain a set of VirtualInstrument object with key as VIName.
*/
class VirtualInstrumentManager : public ::Singleton<VirtualInstrumentManager> {
public:
typedef std::map<std::string,VirtualInstrumentWPtr> VirtualInstrumentMap;
// Design pattern
friend class Singleton<VirtualInstrumentManager>;
/**
* @brief If the VI not exist, create it.
* @return a SharedPtr on a VirtualInstrument.
*/
VirtualInstrumentSPtr getVirtualInstrument(const std::string& pVirtualInstrumentName);
const char* getUserHost();
const char* getUserName();
int ddErrorToAmdaError(int ddError);
private:
VirtualInstrumentManager();
virtual ~VirtualInstrumentManager();
VirtualInstrumentMap _virtualInstrumentMap; /*!< VirtualInstrument list */
std::string _userHost;
std::string _userName;
};
} /* namespace DDServerInterface */
} /* namespace AMDA */
#endif /* VIRTUALINSTRUMENTMANAGER_HH_ */