ASN1C C/C++ Common Runtime  ASN1C v7.8.x
OSRTStream.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2003-2022 Objective Systems, Inc.
3  *
4  * This software is furnished under a license and may be used and copied
5  * only in accordance with the terms of such license and with the
6  * inclusion of the above copyright notice. This software or any other
7  * copies thereof may not be provided or otherwise made available to any
8  * other person. No title to and ownership of the software is hereby
9  * transferred.
10  *
11  * The information in this software is subject to change without notice
12  * and should not be construed as a commitment by Objective Systems, Inc.
13  *
14  * PROPRIETARY NOTICE
15  *
16  * This software is an unpublished work subject to a confidentiality agreement
17  * and is protected by copyright and trade secret law. Unauthorized copying,
18  * redistribution or other use of this work is prohibited.
19  *
20  * The above notice of copyright on this source code product does not indicate
21  * any actual or intended publication of such source code.
22  *
23  *****************************************************************************/
28 #ifndef _OSRTSTREAM_H_
29 #define _OSRTSTREAM_H_
30 
31 #include "rtxsrc/OSRTCtxtHolder.h"
32 #include "rtxsrc/OSRTStreamIF.h"
33 
44 class EXTRTCLASS OSRTStream : public OSRTStreamIF {
45  protected:
46  OSRTCtxtHolder mCtxtHolder;
47  OSBOOL mbAttached;
48  int mStatus;
50 
51  EXTRTMETHOD OSRTStream (OSRTContext* pContext, OSBOOL attachStream = FALSE);
52  EXTRTMETHOD OSRTStream (OSRTStream& original);
53 
60  EXTRTMETHOD OSRTStream ();
61 
62  EXTRTMETHOD char* getErrorInfo (size_t* pBufSize);
63 
64  public:
68  virtual EXTRTMETHOD ~OSRTStream ();
69 
80  virtual EXTRTMETHOD int close ();
81 
90  virtual EXTRTMETHOD int flush ();
91 
101  virtual OSRTCtxtPtr getContext () {
102  return mCtxtHolder.getContext ();
103  }
104 
111  virtual OSCTXT* getCtxtPtr () {
112  return mCtxtHolder.getCtxtPtr ();
113  }
114 
122  virtual char* getErrorInfo () {
123  return mCtxtHolder.getErrorInfo ();
124  }
125 
142  virtual char* getErrorInfo (char* pBuf, size_t& bufSize) {
143  return mCtxtHolder.getErrorInfo (pBuf, bufSize);
144  }
145 
155  inline int getStatus () const {
156  return mStatus;
157  }
158 
159  inline OSBOOL isInitialized () { return (OSBOOL)(mInitStatus == 0); }
160 
166  virtual EXTRTMETHOD OSBOOL isOpened ();
167 
172  inline void printErrorInfo () {
173  mCtxtHolder.printErrorInfo ();
174  }
175 
180  inline void resetErrorInfo () {
181  mStatus = 0;
182  mCtxtHolder.resetErrorInfo ();
183  }
184 
185 } ;
186 
189 #endif
Definition: OSRTStream.h:44
int mInitStatus
Initialization status. 0 if initialized successfully.
Definition: OSRTStream.h:49
OSBOOL mbAttached
Flag, TRUE for "attached" streams.
Definition: OSRTStream.h:47
void resetErrorInfo()
Definition: OSRTStream.h:180
virtual char * getErrorInfo(char *pBuf, size_t &bufSize)
Definition: OSRTStream.h:142
virtual char * getErrorInfo()
Definition: OSRTStream.h:122
int getStatus() const
Definition: OSRTStream.h:155
void printErrorInfo()
Definition: OSRTStream.h:172
Definition: OSRTContext.h:310
Definition: OSRTContext.h:64
int mStatus
Last stream operation status.
Definition: OSRTStream.h:48
Definition: rtxContext.h:198
virtual OSCTXT * getCtxtPtr()
Definition: OSRTStream.h:111
virtual OSRTCtxtPtr getContext()
Definition: OSRTStream.h:101