You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
80 lines
1.8 KiB
80 lines
1.8 KiB
// Copyright 2020 Siemens Digital Industries Software
|
|
// ==================================================
|
|
// Copyright 2013.
|
|
// Siemens Product Lifecycle Management Software Inc.
|
|
// All Rights Reserved.
|
|
// ==================================================
|
|
// Copyright 2020 Siemens Digital Industries Software
|
|
|
|
/**
|
|
@file
|
|
Defines the class status_t, which can be used to describe the return status of a function or method.
|
|
*/
|
|
/* */
|
|
#ifndef TEAMCENTER_BASE_UTILS_STATUS_T_HXX
|
|
#define TEAMCENTER_BASE_UTILS_STATUS_T_HXX
|
|
|
|
#include <base_utils/libbase_utils_exports.h>
|
|
|
|
/**
|
|
@brief Instances of status_t can be used to describe the return status of a function or method.
|
|
<br>The returned value can later be leveraged through the class #ResultStatus.
|
|
*/
|
|
class BASE_UTILS_API status_t
|
|
{
|
|
public:
|
|
/**
|
|
The status_t instance that refers to an OK status
|
|
*/
|
|
static const status_t OK;
|
|
|
|
/**
|
|
The status_t instance that refers to an error status
|
|
*/
|
|
static const status_t NOT_OK;
|
|
|
|
/**
|
|
Constructor
|
|
*/
|
|
status_t();
|
|
|
|
/**
|
|
Copy constructor
|
|
*/
|
|
status_t( const status_t& other );
|
|
|
|
/**
|
|
Destructor
|
|
*/
|
|
~status_t();
|
|
|
|
/**
|
|
Operator =
|
|
*/
|
|
status_t& operator = (const status_t& other);
|
|
|
|
/**
|
|
Operator ==
|
|
*/
|
|
bool operator == (const status_t &other) const;
|
|
|
|
/**
|
|
Operator !=
|
|
*/
|
|
bool operator != (const status_t &other) const;
|
|
|
|
|
|
private:
|
|
enum value_type { UNSET_VALUE, NOT_OK_VALUE, OK_VALUE };
|
|
explicit status_t ( value_type v );
|
|
|
|
void setValue ( value_type theValue );
|
|
void checkMe();
|
|
static void validate( value_type theValue);
|
|
value_type value;
|
|
char *traceback;
|
|
};
|
|
|
|
#include <base_utils/libbase_utils_undef.h>
|
|
#endif
|