PortSupplier_impl.h
Go to the documentation of this file.
1 /*
2  * This file is protected by Copyright. Please refer to the COPYRIGHT file
3  * distributed with this source distribution.
4  *
5  * This file is part of REDHAWK core.
6  *
7  * REDHAWK core is free software: you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License as published by the
9  * Free Software Foundation, either version 3 of the License, or (at your
10  * option) any later version.
11  *
12  * REDHAWK core is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
15  * for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this program. If not, see http://www.gnu.org/licenses/.
19  */
20 
21 
22 #ifndef PORTSUPPLIER_IMPL_H
23 #define PORTSUPPLIER_IMPL_H
24 
25 #include <map>
26 #include <string>
27 
28 #include "CF/cf.h"
29 #include "Port_impl.h"
30 #include "debug.h"
31 #include "ossie/Autocomplete.h"
32 
33 /*
34 The port supplier provides specialized functionality to manage Ports
35 */
36 
38 #ifdef BEGIN_AUTOCOMPLETE_IGNORE
39  : public virtual POA_CF::PortSupplier
40 #endif
41 {
42  ENABLE_LOGGING;
43 
44 public:
46 
47  // Return an object reference for the named port.
48  CORBA::Object* getPort (const char*) throw (CF::PortSupplier::UnknownPort, CORBA::SystemException);
49  CF::PortSupplier::PortInfoSequence* getPortSet ();
50 
51 protected:
52  typedef std::map<std::string, PortBase*> PortServantMap;
53  PortServantMap _portServants;
54 
55  void addPort (const std::string& name, PortBase* servant);
56  void addPort (const std::string& name, const std::string& description, PortBase* servant);
57  void releasePorts ();
58 
59  void startPorts ();
60  void stopPorts ();
61 
62  // Legacy interface; new components should use the above methods
63  typedef std::map<std::string, Port_Uses_base_impl *> RH_UsesPortMap;
64  typedef std::map<std::string, Port_Provides_base_impl *> RH_ProvidesPortMap;
65 
66  RH_UsesPortMap outPorts;
67  std::map<std::string, CF::Port_var> outPorts_var;
68  RH_ProvidesPortMap inPorts;
69 
71  void registerOutPort(Port_Uses_base_impl *port, CF::Port_ptr ref);
72 
73  void releaseInPorts();
74  void releaseOutPorts();
75  void deactivateOutPorts();
76  void deactivateInPorts();
77 
78 private:
79  void insertPort (const std::string& name, PortBase* servant);
80  void deactivatePort (PortBase* servant);
81 };
82 
83 #endif
RH_UsesPortMap outPorts
Definition: PortSupplier_impl.h:66
Definition: Port_impl.h:364
void addPort(const std::string &name, PortBase *servant)
std::map< std::string, CF::Port_var > outPorts_var
Definition: PortSupplier_impl.h:67
CF::PortSupplier::PortInfoSequence * getPortSet()
void deactivateOutPorts()
std::map< std::string, PortBase * > PortServantMap
Definition: PortSupplier_impl.h:52
void registerOutPort(Port_Uses_base_impl *port, CF::Port_ptr ref)
void registerInPort(Port_Provides_base_impl *port)
std::map< std::string, Port_Uses_base_impl * > RH_UsesPortMap
Definition: PortSupplier_impl.h:63
CORBA::Object * getPort(const char *)
PortServantMap _portServants
Definition: PortSupplier_impl.h:53
void deactivateInPorts()
Definition: PortSupplier_impl.h:37
RH_ProvidesPortMap inPorts
Definition: PortSupplier_impl.h:68
Definition: Port_impl.h:259
std::map< std::string, Port_Provides_base_impl * > RH_ProvidesPortMap
Definition: PortSupplier_impl.h:64
Definition: Port_impl.h:320