| 1 | /**************************************************************************** |
|---|
| 2 | |
|---|
| 3 | Copyright 2006 Virginia Polytechnic Institute and State University |
|---|
| 4 | |
|---|
| 5 | This file is part of the OSSIE GenericAssControl. |
|---|
| 6 | |
|---|
| 7 | OSSIE GenericAssControl is free software; you can redistribute it and/or modify |
|---|
| 8 | it under the terms of the GNU General Public License as published by |
|---|
| 9 | the Free Software Foundation; either version 2 of the License, or |
|---|
| 10 | (at your option) any later version. |
|---|
| 11 | |
|---|
| 12 | OSSIE GenericAssControl is distributed in the hope that it will be useful, |
|---|
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 15 | GNU General Public License for more details. |
|---|
| 16 | |
|---|
| 17 | You should have received a copy of the GNU General Public License |
|---|
| 18 | along with OSSIE GenericAssControl; if not, write to the Free Software |
|---|
| 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 20 | |
|---|
| 21 | ****************************************************************************/ |
|---|
| 22 | |
|---|
| 23 | #include <vector> |
|---|
| 24 | #include "ossie/cf.h" |
|---|
| 25 | #include "ossie/PortTypes.h" |
|---|
| 26 | |
|---|
| 27 | #include "ossie/Resource_impl.h" |
|---|
| 28 | #include "GenericAssControl.h" |
|---|
| 29 | |
|---|
| 30 | // Declaration for provides ports |
|---|
| 31 | #ifndef dataIn_Resource_i_H |
|---|
| 32 | #define dataIn_Resource_i_H |
|---|
| 33 | class dataIn_Resource_i : |
|---|
| 34 | public POA_CF::Resource |
|---|
| 35 | { |
|---|
| 36 | public: |
|---|
| 37 | dataIn_Resource_i(GenericAssControl_i *_genericasscontrol); |
|---|
| 38 | |
|---|
| 39 | void start(); |
|---|
| 40 | void stop(); |
|---|
| 41 | |
|---|
| 42 | private: |
|---|
| 43 | GenericAssControl_i *genericasscontrol; |
|---|
| 44 | }; |
|---|
| 45 | #endif |
|---|
| 46 | |
|---|
| 47 | // Declaration for uses ports |
|---|
| 48 | |
|---|
| 49 | #ifndef dataOut_Resource_i_H |
|---|
| 50 | #define dataOut_Resource_i_H |
|---|
| 51 | class dataOut_Resource_i : |
|---|
| 52 | public virtual POA_CF::Port |
|---|
| 53 | { |
|---|
| 54 | public: |
|---|
| 55 | dataOut_Resource_i(GenericAssControl_i *_genericasscontrol); |
|---|
| 56 | void connectPort(CORBA::Object_ptr connection, const char* connectionId); |
|---|
| 57 | void disconnectPort(const char* connectionId); |
|---|
| 58 | |
|---|
| 59 | //Port Information Storage Class |
|---|
| 60 | class PortInfo { |
|---|
| 61 | public: |
|---|
| 62 | PortInfo(CF::Resource_var _port, const char *&_id) |
|---|
| 63 | { |
|---|
| 64 | port_var = _port; |
|---|
| 65 | connectionId = _id; |
|---|
| 66 | }; |
|---|
| 67 | |
|---|
| 68 | PortInfo(const PortInfo &cp) |
|---|
| 69 | { |
|---|
| 70 | port_var = cp.port_var; |
|---|
| 71 | connectionId = cp.connectionId; |
|---|
| 72 | }; |
|---|
| 73 | |
|---|
| 74 | CF::Resource_var port_var; |
|---|
| 75 | std::string connectionId; |
|---|
| 76 | |
|---|
| 77 | private: |
|---|
| 78 | PortInfo(); //no default constructor |
|---|
| 79 | }; |
|---|
| 80 | |
|---|
| 81 | std::vector <dataOut_Resource_i::PortInfo> get_ports(); |
|---|
| 82 | |
|---|
| 83 | private: |
|---|
| 84 | std::vector <dataOut_Resource_i::PortInfo> outPorts; |
|---|
| 85 | GenericAssControl_i *genericasscontrol; |
|---|
| 86 | |
|---|
| 87 | }; |
|---|
| 88 | #endif |
|---|
| 89 | |
|---|
| 90 | |
|---|
| 91 | |
|---|