root/ossiedev/branches/ssayed/devs/src/system/standardInterfaces-metadata/include/standardinterfaces-metadata/complexShortMD_u.h @ 8424

Revision 8424, 3.3 KB (checked in by shereef, 5 years ago)

merged ossiedev/trunk to my branch

RevLine 
[8097]1/****************************************************************************
2
3Copyright 2006, Virginia Polytechnic Institute and State University
4
5This file is part of the OSSIE Core Framework.
6
7OSSIE Core Framework is free software; you can redistribute it and/or modify
8it under the terms of the Lesser GNU General Public License as published by
9the Free Software Foundation; either version 2.1 of the License, or
10(at your option) any later version.
11
12OSSIE Core Framework is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15Lesser GNU General Public License for more details.
16
17You should have received a copy of the Lesser GNU General Public License
18along with OSSIE Core Framework; if not, write to the Free Software
19Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20
21****************************************************************************/
22
23#ifndef COMPLEXSHORT_U_H
24#define COMPLEXSHORT_U_H
25
26#include <string>
27#include <vector>
28
29#ifdef HAVE_OMNIORB4
30#include "omniORB4/CORBA.h"
31#endif
32
33#include <omnithread.h>
34
35#include <ossie/PortTypes.h>
36#include <ossie/cf.h>
37
38#include <standardinterfaces-metadata/complexShortMD.h>
39#include "standardinterfaces-metadata/RadioMetaData_impl.h"
40
41// Forward declaration
42namespace complexShort {
43
44  class usesPort;
45  class ConnectionInfo;
46}
47
[8173]48namespace standardInterfacesMD_i {
[8097]49
50  class complexShort_u {
51    friend class complexShort::usesPort;
52
53  public:
54    complexShort_u(const char* portName);
55    complexShort_u(const char* portName, const char* domainName);
56    ~complexShort_u();
57
58    CORBA::Object_ptr getPort(const char* portName);
59
60    void pushPacket(
61            const PortTypes::ShortSequence &I,
62            const PortTypes::ShortSequence &Q);
63
64    void pushPacket(
65            const PortTypes::ShortSequence &I,
66            const PortTypes::ShortSequence &Q,
[8173]67            const standardInterfacesMD::MetaData &packet_data);
[8097]68
69  private:
70    complexShort_u();
71    complexShort_u(const complexShort_u &);
72
73    std::string portName;
74
75    // Uses port
76    complexShort::usesPort *data_servant;
77    CF::Port_var data_servant_var;
78    std::vector <complexShort::ConnectionInfo> dest_ports;
79    omni_mutex port_mutex;
80
81    /// Data to be pushed for each packet
[8173]82    standardInterfacesMD::MetaData metadata;
[8097]83
84  };
85
86}
87
88namespace complexShort {
89
90  class usesPort : public virtual POA_CF::Port {
91  public:
[8173]92    usesPort(standardInterfacesMD_i::complexShort_u *_base);
[8097]93    ~usesPort();
94
95    void connectPort(CORBA::Object_ptr connection, const char* connectionID);
96    void disconnectPort(const char* connectionID);
97
98  private:
[8173]99    standardInterfacesMD_i::complexShort_u *base;
[8097]100  };
101
102
103  class ConnectionInfo
104    {
105    public:
[8173]106      ConnectionInfo(standardInterfacesMD::complexShortMD_ptr _port, const char* _ID) : port_obj( _port), identifier(_ID) { };
[8097]107      ConnectionInfo(const ConnectionInfo & c) { port_obj = c.port_obj; identifier = c.identifier;};
108     
[8173]109      void setPort(standardInterfacesMD::complexShortMD_ptr _port) {port_obj = _port; };
[8097]110      const char *getID() {return identifier.c_str(); };
111
[8173]112      standardInterfacesMD::complexShortMD_var port_obj;
[8097]113
114    private:
115      ConnectionInfo();  // No default constructor
116
117      std::string identifier;
118    };
119
120}
121
122#endif
Note: See TracBrowser for help on using the browser.