source: trunk/ETSI-Testsuites/ETSI_auto_IOT/adapter/src/UpperTestAdapter/UpperTestAdapter.h @ 53

Last change on this file since 53 was 22, checked in by rings, 14 years ago
  • Property svn:executable set to *
File size: 3.3 KB
Line 
1#ifndef UpperTestAdapter_h
2#define UpperTestAdapter_h
3
4// Boost headers.
5#include <boost/shared_ptr.hpp>
6// Singleton pattern.
7#include "Helper/Singleton.h"
8#include "Helper/GeneralConfigurationParams.h"
9#include "Helper/Exceptions.h"
10
11#include "Messages/CommonTrafficCaptureMessages.h"
12// TTCN-3 ports.
13#include "Ports/EquipmentAccessPort.h"
14// Internal UpperTestAdapter.
15#include "Processors/ProcessorsImpl.h"
16
17namespace UpperTestAdapter {
18
19/*! Class UpperTestAdapter
20 * \brief This class implements the processing of TriggerCommands messages and Eut configuration commands.
21 * This class is used as a singleton.
22 */
23class UpperTestAdapter  : public Singleton<UpperTestAdapter>
24{
25  //! Singleton pattern implementation.
26  friend class Singleton<UpperTestAdapter>;
27 
28  //! UpperTestAdapter.
29  /*! Default ctor. Shall be declared in private part due to Singleton pattern implementation.
30   */
31  UpperTestAdapter();
32
33  /*
34   * Port registering part.
35   */
36  //! Mapping of the registered EquipmentAccessPort ports.
37  std::map<const t3devlib::ComponentId *, std::pair<t3devlib::PortId *, boost::shared_ptr<Processors::ProcessorsImpl> > >  m_mapRegisteredPorts;
38  /*! This list will be used to assign properly the EUT interfaces description sent into GeneralConfigurationReq with the ports.
39   * Becarefull: the order of the EIUT registration port SHALL be the same than the EUT interfaces description
40   */
41  std::list<const t3devlib::ComponentId *> m_connectedComponents;
42 
43public:
44  //! Default dtor.
45  /*! Default dtor.
46   */
47  ~UpperTestAdapter();
48 
49public: // Public interface
50  //! Initialize the component.
51  /*! Initialize the component.
52   * @param configParams: GeneralConfigureReq parmeters.
53   * @return true on success, false otherwise.
54   */
55  bool Initialize(boost::shared_ptr<GeneralConfigurationParams> configParams) throw(UpperTestAdapterException);
56  //! Register a new TriggerPort TTCN-3 port instance.
57  /*! Register a new TriggerPort TTCN-3 port instance.
58   * @param pPort: port instance
59   * @param pComponent: TTCN-3 component reference
60   */
61  void RegisterEquipmentAccessPort(t3devlib::PortId *pPort, const t3devlib::ComponentId *pComponent);
62  //void RegisterEutConfigPort(PortId *pPort, const ComponentId *pComponent); 
63  //! Register a new EutConfigPort TTCN-3 port instance.
64  /*! Register a new EutConfigPort instance.
65   * @param pComponent: TTCN-3 component reference
66   * @return PortId reference on success, NULL otherwise.
67   */
68  t3devlib::PortId * GetEquipmentAccessPortIdFromComponent(const t3devlib::ComponentId& from);
69 
70  // TODO: Add Deregister port to free smart pointers.
71 
72 
73  //! ProcessTriggerCommand.
74  /*! Process a TriggerCommands message in synchronous mode.
75   * @param from:
76   * @param signatureId: Component referencetrigger
77   * @param trigger: trigger command
78   * @param parameterList:
79   * @return true on success, false otherwise.
80   */
81  int ProcessTriggerCommand(const t3devlib::ComponentId &from, const std::string &trigger, const std::vector<std::string> &parameterList);
82
83  // TODO: Add asynchronous Trigger command processing
84  //void InvokeProcessTriggerCommand(const t3devlib:ComponentId &from, const t3devlib:QName &signatureId, const ParameterList &parameterList);
85};
86
87} // namespace
88
89#endif // UpperTestAdapter_h
Note: See TracBrowser for help on using the repository browser.