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

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