+#ifndef ERROR_CODE_H
+#define ERROR_CODE_H
+//
+//! @file error_code.h
+//! @brief error code and error messege impliment class
+// coipyright (C) NTTComware corporation. 2008 - 2009
+// mail: n.nakai at sdy.co.jp
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
#include <string>
namespace l7vs{
std::string msg;
public:
error_code() : flag(false){} //!< constractor
- error_code( bool inflg, std::string& instr ){
+ //! copy constractor
+ //! @param[in] flags
+ //! @param[in] error message
+ error_code( const bool inflg, const std::string& instr ){
flag = inflg;
msg = instr;
}
typedef void (*unspecified_bool_type)(); //!< if return function
static void unspecified_bool_true() {} //!< if true orverload function
operator unspecified_bool_type() const { return flag == 0 ? 0 : unspecified_bool_true; } //!< if() orverload
- const std::string& get_message() const { return msg; } //
+ const std::string& get_message() const { return msg; } //!< message getter
+ //! error setter
+ //! @param[in] flags
+ //! @param[in] error message
+ void setter( const bool flg, const std::string& instr ){
+ flag = flg;
+ msg = instr;
+ }
};
}
+
+#endif // ERROR_CODE_H