Atlas  0.7.0
Networking protocol for the Worldforge system.
Decoder.h
1 // This file may be redistributed and modified only under the terms of
2 // the GNU Lesser General Public License (See COPYING for details).
3 // Copyright 2000-2001 Stefanus Du Toit and Aloril.
4 // Copyright 2001-2005 Alistair Riddoch.
5 // Copyright 2019 Erik Ogenvik.
6 
7 #ifndef ATLAS_OBJECTS_DECODER_H
8 #define ATLAS_OBJECTS_DECODER_H
9 
10 
11 #include <Atlas/Message/DecoderBase.h>
12 
13 namespace Atlas {
14 namespace Objects {
15 
16 template<class T>
17 class SmartPtr;
18 
19 class RootData;
20 
21 typedef SmartPtr<RootData> Root;
22 
23 class Factories;
24 
36 public:
38  explicit ObjectsDecoder(const Factories& f);
39 
41  ~ObjectsDecoder() override;
42 
44  const Factories& factories() const {
45  return m_factories;
46  }
47 
48 protected:
50  void messageArrived(Atlas::Message::MapType) override;
51 
53  virtual void objectArrived(Root obj) = 0;
54 
55  const Factories& m_factories;
56 };
57 
58 }
59 } // namespace Atlas::Objects
60 
61 #endif // ATLAS_OBJECTS_DECODER_H
void messageArrived(Atlas::Message::MapType) override
Overridden by to retrieve the message from DecoderBase.
Definition: Decoder.cpp:20
ObjectsDecoder(const Factories &f)
Constructor.
Definition: Decoder.cpp:14
const Factories & factories() const
Factories accessor.
Definition: Decoder.h:44
~ObjectsDecoder() override
Default destructor.
virtual void objectArrived(Root obj)=0
call right object*Arrived method
Definition: Bridge.h:21