OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / I386LINUX / util / I386LINUX / include / coss / Externalization_impl.h
1 /*
2  *  Externaization Service for MICO
3  *  Copyright (C) 1999 Dmitry V. Sedov
4  *
5  *  This library is free software; you can redistribute it and/or
6  *  modify it under the terms of the GNU Library General Public
7  *  License as published by the Free Software Foundation; either
8  *  version 2 of the License, or (at your option) any later version.
9  *
10  *  This library is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  *  Library General Public License for more details.
14  *
15  *  You should have received a copy of the GNU Library General Public
16  *  License along with this library; if not, write to the Free
17  *  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  *
19  *  Send comments and/or bug reports to:
20  *                 mico@informatik.uni-frankfurt.de
21  *  or to my private e-mail:
22  *                 sedov@postman.simcb.ru
23  */
24
25 #ifndef __CosExternalization_impl_h__
26 #define __CosExternalization_impl_h__
27
28 #include <coss/CosExternalization.h>
29
30 class Stream_impl : virtual public POA_CosExternalization::Stream,
31                     virtual public POA_CosLifeCycle::LifeCycleObject
32 {
33     CORBA::String_var filename_;
34     CosLifeCycle::Key factory_id_;
35     istream* ifstream_;
36     ostream* ofstream_;
37     CORBA::Boolean context;
38     
39 public:
40     Stream_impl(const char* filename = NULL);
41     ~Stream_impl();
42
43 // Function From LifeCycleObject Interface
44     virtual CosLifeCycle::LifeCycleObject_ptr copy(CosLifeCycle::FactoryFinder_ptr there,
45                                                    const CosLifeCycle::Criteria& the_criteria);
46
47     virtual void move(CosLifeCycle::FactoryFinder_ptr there,
48                       const CosLifeCycle::Criteria& the_criteria);
49
50     virtual void remove();
51 //  **********************************************
52
53     virtual void externalize(CosStream::Streamable_ptr theObject);
54
55     virtual CosStream::Streamable_ptr internalize(CosLifeCycle::FactoryFinder_ptr there);
56
57     virtual void begin_context();
58
59     virtual void end_context();
60
61     virtual void flush();
62 };
63
64 class StreamFactory_impl : virtual public POA_CosExternalization::StreamFactory
65 {
66 public:
67     StreamFactory_impl();
68     virtual CosExternalization::Stream_ptr create();
69 };
70
71 class FileStreamFactory_impl : virtual public POA_CosExternalization::FileStreamFactory
72 {
73 public:
74     FileStreamFactory_impl();
75     virtual CosExternalization::Stream_ptr create(const char* theFileName);
76 };
77
78 #endif __CosExternalization_impl_h__