| 115 | /// \brief A function object. |
| 116 | template<class Signature> |
| 117 | class function |
| 118 | { |
| 119 | public: |
| 120 | /// \internal_ |
| 121 | typedef typename |
| 122 | boost::function_traits<Signature>::result_type result_type; |
| 123 | |
| 124 | /// \internal_ |
| 125 | BOOST_STATIC_CONSTANT( |
| 126 | size_t, arity = boost::function_traits<Signature>::arity |
| 127 | ); |
| 128 | |
| 129 | /// \internal_ |
| 130 | typedef Signature signature; |
| 131 | |
| 132 | /// Creates a new function object with \p name. |
| 133 | function(const std::string &name) |
| 134 | : m_name(name) |
| 135 | { |
| 136 | } |
| 137 | |
| 138 | /// Destroys the function object. |
| 139 | ~function() |
| 140 | { |
| 141 | } |
| 142 | |
| 143 | /// \internal_ |
| 144 | std::string name() const |
| 145 | { |
| 146 | return m_name; |
| 147 | } |
| 148 | |
| 149 | /// \internal_ |
| 150 | void set_source(const std::string &source) |
| 151 | { |
| 152 | m_source = source; |
| 153 | } |
| 154 | |
| 155 | /// \internal_ |
| 156 | std::string source() const |
| 157 | { |
| 158 | return m_source; |
| 159 | } |
| 160 | |
| 161 | /// \internal_ |
| 162 | void define(std::string name, std::string value = std::string()) |
| 163 | { |
| 164 | m_definitions[name] = value; |
| 165 | } |
| 166 | |
| 167 | bool operator==(const function<Signature>& other) const |
| 168 | { |
| 169 | return |
| 170 | (m_name == other.m_name) |
| 171 | && (m_definitions == other.m_definitions) |
| 172 | && (m_source == other.m_source); |
| 173 | } |
| 174 |
no outgoing calls
no test coverage detected