humoto
model.h
Go to the documentation of this file.
1 /**
2  @file
3  @author Alexander Sherikov
4  @copyright 2014-2017 INRIA. Licensed under the Apache License, Version 2.0.
5  (see @ref LICENSE or http://www.apache.org/licenses/LICENSE-2.0)
6 
7  @brief
8 */
9 
10 #pragma once
11 
12 
13 namespace humoto
14 {
15  /**
16  * @brief Abstract class to be used for interfaces.
17  */
19  {
20  protected:
21  /**
22  * @brief Protected destructor: prevent destruction of the child
23  * classes through a base pointer.
24  */
27 
28 
29  public:
30  virtual void log(humoto::Logger &, const LogEntryName &, const std::string &) const = 0;
31  };
32 
33 
34 
35  /**
36  * @brief Instances of this class are passed to a virtual method '@ref
37  * humoto::TaskBase::form()', so even though this class is basically
38  * useless in its present form we cannot avoid its definition using a
39  * template.
40  */
42  {
43  protected:
44  /**
45  * @brief Protected destructor: prevent destruction of the child
46  * classes through a base pointer.
47  */
48  ~Model() {}
49  Model() {}
50 
51 
52  public:
53  virtual void updateState(const humoto::ModelState &) = 0;
54 
55  virtual void log(humoto::Logger &, const LogEntryName &, const std::string &) const = 0;
56 
57  void noop() const
58  {
59  }
60  };
61 }
void noop() const
Definition: model.h:57
#define HUMOTO_LOCAL
Definition: export_import.h:26
Represents log entry name.
Definition: logger.h:169
Threaded logger: any data sent to this logger is wrapped in a message and pushed to a queue...
Definition: logger.h:555
~ModelState()
Protected destructor: prevent destruction of the child classes through a base pointer.
Definition: model.h:25
~Model()
Protected destructor: prevent destruction of the child classes through a base pointer.
Definition: model.h:48
The root namespace of HuMoTo.
Definition: config.h:12
Instances of this class are passed to a virtual method 'humoto::TaskBase::form()', so even though this class is basically useless in its present form we cannot avoid its definition using a template.
Definition: model.h:41
Abstract class to be used for interfaces.
Definition: model.h:18