4 #ifndef FIRE_OBJECT_HPP_INCLUDED
5 #define FIRE_OBJECT_HPP_INCLUDED
7 #include <boost/property_tree/ptree.hpp>
8 #include <boost/property_tree/json_parser.hpp>
9 #include <boost/thread.hpp>
15 #include "fire/export.hpp"
17 #include "fire/Groupable.hpp"
18 #include "fire/Class.hpp"
35 typedef boost::unique_lock< boost::mutex >
LockGuard;
42 mutable boost::condition_variable conditionVariable;
112 virtual bool equals(
const Object&
object)
const;
123 virtual bool operator==(
const Object&
object)
const;
131 std::size_t hashCode()
const;
141 void notifyAll()
const;
149 virtual std::string toString()
const;
162 void waitFor(std::size_t timeout)
const;
173 void waitFor(std::size_t timeout,
int nanos)
const;
184 virtual bool operator<(
const Object&
object)
const;
200 boost::property_tree::ptree tree;
202 tree.put< std::string >(
"class", clazz->
getName());
204 std::stringstream stringStream;
205 boost::property_tree::write_json(stringStream, tree);
206 outputStream << stringStream.str();
207 }
catch (
const std::exception& exception) {
228 inputStream >> string;
229 boost::property_tree::ptree tree;
230 std::stringstream stringStream;
231 stringStream.str(
string);
232 boost::property_tree::read_json(stringStream, tree);
233 }
catch (
const std::exception& exception) {
friend std::ostream & operator<<(std::ostream &outputStream, const Object &object)
Operatore di uscita.
Definition: Object.hpp:198
Classe per la gestione di un oggetto.
Definition: Object.hpp:29
boost::unique_lock< boost::mutex > LockGuard
Guardia per la sincronizzazione dell'oggetto.
Definition: Object.hpp:35
boost::mutex mutex
Variabile per la sincronizzazione dell'oggetto.
Definition: Object.hpp:49
Classe per la gestione di una classe contenente le informazioni di una classe.
Definition: Class.hpp:33
friend std::istream & operator>>(std::istream &inputStream, Object &)
Operatore di ingresso.
Definition: Object.hpp:225
std::string getName() const
Restituisce il nome della classe.
Definition: Class.hpp:99
Interfaccia per la gestione di un oggetto raggruppabile.
Definition: Groupable.hpp:20