OnixS C++ MTS Repo SDP Handler
1.3.2.8
API documentation
Home
Contents
Namespaces
Classes
Files
File List
File Members
include
OnixS
MTS
Repo
SDP
ErrorListener.h
Go to the documentation of this file.
1
#pragma once
2
/*
3
* Copyright Onix Solutions Limited [OnixS]. All rights reserved.
4
*
5
* This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
6
* and international copyright treaties.
7
*
8
* Access to and use of the software is governed by the terms of the applicable ONIXS Software
9
* Services Agreement (the Agreement) and Customer end user license agreements granting
10
* a non-assignable, non-transferable and non-exclusive license to use the software
11
* for it's own data processing purposes under the terms defined in the Agreement.
12
*
13
* Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
14
* of this source code or associated reference material to any other location for further reproduction
15
* or redistribution, and any amendments to this copyright notice, are expressly prohibited.
16
*
17
* Any reproduction or redistribution for sale or hiring of the Software not in accordance with
18
* the terms of the Agreement is a violation of copyright law.
19
*/
20
21
#include <string>
22
23
#include <
OnixS/MTS/Repo/SDP/ABI.h
>
24
25
namespace
OnixS
{
26
namespace
Mts {
27
namespace
Repo {
28
namespace
SDP {
29
/// Known (selected) error codes.
30
///
31
struct
ONIXS_MTS_REPO_SDP_API
ErrorCode
32
{
33
/// @copydoc ErrorCode
34
///
35
enum
Enum
36
{
37
General = 1,
///< Identifies errors of generic nature.
38
};
39
};
40
41
/// Returns string representation of ErrorCode value.
42
///
43
ONIXS_MTS_REPO_SDP_API
std::string
enumToString
(
ErrorCode::Enum
);
44
45
/// Defines an interface through which the Handler notifies subscribers
46
/// about errors occurred while processing messages.
47
class
ErrorListener
48
{
49
public
:
50
/// Implement this member to get notified about errors.
51
/// @param code identifies error occurred while processing messages.
52
/// @param description supplies notes on occurred error.
53
/// @note Usually, Handler is capable to recover from errors by itself.
54
/// That means, there's no need to restart manually.
55
/// Instead, Handler will perform all necessary recovering by itself.
56
virtual
void
onError (
ErrorCode::Enum
code,
const
std::string& description) = 0;
57
58
protected
:
59
/// Class provides an interface for handling errors in subscriptions.
60
/// It doesn't provide an interface for instance deletion. However,
61
/// since C++ doesn't have pure interface concept, destructor will be
62
/// generated anyway. We can only control proper use of it. For this
63
/// reason we hide from public use and make it available for descendants.
64
virtual
~ErrorListener
() {}
65
};
66
67
}
68
}
69
}
70
}
OnixS::Mts::Repo::SDP::ErrorCode::Enum
Enum
Definition:
ErrorListener.h:35
ABI.h
OnixS::Mts::Repo::SDP::enumToString
std::string enumToString(ErrorCode::Enum)
OnixS
Definition:
ActResultListener.h:25
OnixS::Mts::Repo::SDP::ErrorListener::~ErrorListener
virtual ~ErrorListener()
Definition:
ErrorListener.h:64
OnixS::Mts::Repo::SDP::ErrorListener
Definition:
ErrorListener.h:47
OnixS::Mts::Repo::SDP::ErrorCode
Definition:
ErrorListener.h:31
ONIXS_MTS_REPO_SDP_API
#define ONIXS_MTS_REPO_SDP_API
Definition:
ABI.h:49