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
Atlas::Objects::ObjectsDecoder::messageArrived
void messageArrived(Atlas::Message::MapType) override
Overridden by to retrieve the message from DecoderBase.
Definition: Decoder.cpp:20
Atlas::Objects::ObjectsDecoder::ObjectsDecoder
ObjectsDecoder(const Factories &f)
Constructor.
Definition: Decoder.cpp:14
Atlas::Objects::ObjectsDecoder::~ObjectsDecoder
~ObjectsDecoder() override
Default destructor.
Atlas::Objects::ObjectsDecoder::objectArrived
virtual void objectArrived(Root obj)=0
call right object*Arrived method
Atlas::Objects::ObjectsDecoder
Definition: Decoder.h:35
Atlas::Objects::ObjectsDecoder::factories
const Factories & factories() const
Factories accessor.
Definition: Decoder.h:44
Atlas::Objects::Factories
Definition: Factories.h:76
Atlas::Objects::RootData
All objects inherit from this..
Definition: Root.h:37
Atlas::Message::DecoderBase
Definition: DecoderBase.h:41
Atlas::Objects::SmartPtr
Definition: Decoder.h:17
Atlas
Definition: Bridge.h:20