yasmine
state_machine_defect.hpp
Go to the documentation of this file.
1 // //
3 // This file is part of the Seadex yasmine ecosystem (http://yasmine.seadex.de). //
4 // Copyright (C) 2016-2017 Seadex GmbH //
5 // //
6 // Licensing information is available in the folder "license" which is part of this distribution. //
7 // The same information is available on the www @ http://yasmine.seadex.de/Licenses.html. //
8 // //
10 
11 
12 #ifndef STATE_MACHINE_DEFECT_B3B7FA9A_C6E8_496E_8A31_E00451C9B7AC
13 #define STATE_MACHINE_DEFECT_B3B7FA9A_C6E8_496E_8A31_E00451C9B7AC
14 
15 
16 #include "essentials/sxprintf.hpp"
17 #include "essentials/compatibility/compatibility.hpp"
18 
20 
21 
22 namespace sxy
23 {
24 
25 
26 class state_machine_element;
27 
28 
29 class state_machine_defect SX_FINAL
30 {
31 
32 public:
33 
34 
35 #ifndef SX_CPP03_BOOST
36 
37 
38  template< typename ... args >
39  state_machine_defect( const state_machine_element &_element, const std::string & _message, args ... _args ):
40  element_( &_element ), message_( sxe::sxprintf( _message.c_str(), _args ... ) )
41  {
42  // Nothing to do.
43  }
44 
45 
46 #else
47 
48  state_machine_defect( const state_machine_element&_element, const std::string & _message );
49  state_machine_defect( const state_machine_element&_element, const std::string & _message, const sxe::value_type &_value );
50  state_machine_defect( const state_machine_element&_element, const std::string & _message, const sxe::value_type &_value1,
51  const sxe::value_type &_value2 );
52  state_machine_defect( const state_machine_element&_element, const std::string & _message, const sxe::value_type &_value1,
53  const sxe::value_type &_value2, const sxe::value_type&_value3 );
54  state_machine_defect( const state_machine_element&_element, const std::string & _message, const sxe::value_type &_value1,
55  const sxe::value_type &_value2, const sxe::value_type &_value3, const sxe::value_type &_value4 );
56  state_machine_defect( const state_machine_element&_element, const std::string & _message, const sxe::value_type &_value1,
57  const sxe::value_type &_value2, const sxe::value_type &_value3, const sxe::value_type &_value4,
58  const sxe::value_type &_value5 );
59 
60 #endif
61 
62 
63  ~state_machine_defect() SX_NOEXCEPT;
64 
65 
66  const state_machine_element& get_element() const;
67  const std::string& get_message() const;
68 
69 
70 private:
71  const state_machine_element* element_;
72  std::string message_;
73 };
74 
75 
76 void write_defects_to_log( const state_machine_defects& _defects );
77 }
78 
79 
80 #endif
std::vector< state_machine_defect > state_machine_defects
Definition: state_machine_defect_fwd.hpp:23
Definition: state_machine_element.hpp:26
state_machine_defect(const state_machine_element &_element, const std::string &_message, args ... _args)
Definition: state_machine_defect.hpp:39
void write_defects_to_log(const state_machine_defects &_defects)
Definition: state_machine_defect.cpp:100
Definition: adapter_cpp11.hpp:21