/* * 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. */ #ifndef HL7_ANYMSG_H_ #define HL7_ANYMSG_H_ #pragma interface #include "HL7Message.h" #include "UniMesIdCode.h" #include "fBitSet.h" class ANYmsg { BitSet _allowed; HL7Message *_msg; bool _frozen; public: ANYmsg(); ANYmsg(const BitSet&); ANYmsg(const ANYmsg&); ~ANYmsg(); void unset(); const ANYmsg& operator = (const HL7Message &); const ANYmsg& operator = (const ANYmsg &); HL7Message* const operator -> () const; HL7Message& operator * () const; operator HL7Message* () const; operator HL7Message& () const; HL7Message *msg(); void freeze(bool flag = true); bool frozen(); bool ispresent() const; UniMesIdCode::Value type() const; result input(istream&); void output(ostream&) const; bool OK() const; BitSet allowed() const; void reallow(const BitSet&); void allow(UniMesIdCode::Value); void allow(); // allow all void forbid(UniMesIdCode::Value); void forbid(); // forbid all inline friend istream& operator >> (istream&, ANYmsg &); inline friend ostream& operator << (ostream&, const ANYmsg &); typedef HL7Message *(*service_t)(HL7Message &request); void register_service(UniMesIdCode::Value, service_t); void serve(const char *service, const char *App = NULL, const char *Fac = NULL, bool exactMatch = false); private: service_t *_services; void init_services(); }; #ifndef OUTLINE # include "ANYmsg.icc" #endif #endif /* !HL7_ANYMSG_H_ */