Blame view

src/ParamGetImpl/DDServerInterface/VirtualInstrumentManager.hh 1.51 KB
fbe3c2bb   Benjamin Renard   First commit
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
/*
 * 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();
29bf0a3d   Elena.Budnik   setUserName() cal...
45
46
			
			const char* getUserName();
80111081   Benjamin Renard   Add executable am...
47
48

			int ddErrorToAmdaError(int ddError);
29bf0a3d   Elena.Budnik   setUserName() cal...
49
			
fbe3c2bb   Benjamin Renard   First commit
50
51
52
53
54
55
		private:
			VirtualInstrumentManager();
			virtual ~VirtualInstrumentManager();

			VirtualInstrumentMap _virtualInstrumentMap; /*!< VirtualInstrument list */
			std::string _userHost;
29bf0a3d   Elena.Budnik   setUserName() cal...
56
			std::string _userName;
fbe3c2bb   Benjamin Renard   First commit
57
58
59
60
61
		};

	} /* namespace DDServerInterface */
} /* namespace AMDA */
#endif /* VIRTUALINSTRUMENTMANAGER_HH_ */