root/standardInterfaces/trunk/standardInterfaces/include/standardinterfaces/complexShort_p.h @ 4246

Revision 4246, 2.6 KB (checked in by jgaeddert, 7 years ago)

improving autofoo of StandardInterfaces

  • Property svn:eol-style set to native
Line 
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_P_H
24#define COMPLEXSHORT_P_H
25
26#include <string>
27#include <vector>
28
29#include <standardinterfaces/complexShort.h>
30
31namespace complexShort {
32  class providesPort;
33}
34
35namespace standardInterfaces_i {
36  class complexShort_p {
37    friend class complexShort::providesPort;
38
39  public:
40    complexShort_p(const char* portName, unsigned int bufLen = 5);
41    complexShort_p(const char* portName, const char* domainName, unsigned int bufLen = 5);
42    ~complexShort_p();
43
44    CORBA::Object_ptr getPort(const char* portName);
45
46    void getData(PortTypes::ShortSequence* &I, PortTypes::ShortSequence* &Q);
47    void bufferEmptied() { ready_for_input->post(); };
48
49  private:
50    complexShort_p();
51    complexShort_p(const complexShort_p &);
52
53    std::string portName;
54
55    // Provides port
56    complexShort::providesPort *data_servant;
57    standardInterfaces::complexShort_var data_servant_var;
58
59    // Buffer storage
60    unsigned int bufferLength;
61    unsigned int rdPtr;
62    unsigned int wrPtr;
63    std::vector <PortTypes::ShortSequence> I_buf;
64    std::vector <PortTypes::ShortSequence> Q_buf;
65 
66    // Semaphores for synchronization
67    omni_semaphore *data_ready;  // Ready to process data
68    omni_semaphore *ready_for_input; // Ready to receive more data
69
70 };
71
72}
73
74namespace complexShort {
75
76  class providesPort : public POA_standardInterfaces::complexShort {
77  public:
78    providesPort(standardInterfaces_i::complexShort_p* _base);
79    ~providesPort();
80
81    void pushPacket(const PortTypes::ShortSequence &I, const PortTypes::ShortSequence &Q);
82
83  private:
84    standardInterfaces_i::complexShort_p* base;
85  };
86}
87
88
89#endif
Note: See TracBrowser for help on using the browser.