/* * Copyright (c) 1995, 1996 Gunther Schadow. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*********************************************************************** * * Abstract base class for any HL7 object * ***********************************************************************/ #ifndef PG_OBJECT_H_ #define PG_OBJECT_H_ #include #pragma interface #include class PGObject { public: enum { present=1, broken=4, zombie=8, // Vital parameters clear=0, // Abstractions }; /* subclasses of PGObjects */ typedef enum { message = 0, group = 1, segment = 2, primtype = 3, composite = 4, delimiters = 5, repfld = 6, anyseg = 7, repstrc = 8, } subclass_t; private: int _status; subclass_t _subclass; int _type; protected: virtual void set(); public: PGObject(subclass_t sc, int type); virtual ~PGObject(); virtual void unset(); virtual subclass_t subclass() const; /*virtual*/ int type() const; // will be hidden by children virtual bool ispresent() const; virtual bool OK() const; virtual bool commit() = 0; virtual result input (istream&) =0; virtual void output(ostream&) const =0; typedef ios&(*er_manip_t)(ios&); result str2o(const char *str, er_manip_t = NULL); char *o2str(er_manip_t = NULL); inline friend istream& operator>> (istream& is, PGObject& x); inline friend ostream& operator<< (ostream& os, const PGObject& x); }; #ifndef OUTLINE # include "PGObject.icc" #endif #endif /* !PG_HL7OBJECT_H_ */