odil
C++11libraryfortheDICOMstandard
AssociationAcceptor.h
1 /*************************************************************************
2  * odil - Copyright (C) Universite de Strasbourg
3  * Distributed under the terms of the CeCILL-B license, as published by
4  * the CEA-CNRS-INRIA. Refer to the LICENSE file or to
5  * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
6  * for details.
7  ************************************************************************/
8 
9 #ifndef _b21e4f11_9337_4612_8152_b59dedc16f18
10 #define _b21e4f11_9337_4612_8152_b59dedc16f18
11 
12 #include <functional>
13 #include <string>
14 
15 #include "odil/AssociationParameters.h"
16 #include "odil/Exception.h"
17 
18 namespace odil
19 {
20 
27 typedef
28  std::function<AssociationParameters(AssociationParameters const &)>
29  AssociationAcceptor;
30 
38 AssociationParameters
39 default_association_acceptor(AssociationParameters const & input);
40 
43 {
44 public:
47  unsigned char result, unsigned char source, unsigned char reason,
48  std::string const & message="Association rejected");
49 
51  unsigned char get_result() const;
52 
54  void set_result(unsigned char value);
55 
57  unsigned char get_source() const;
58 
60  void set_source(unsigned char value);
61 
63  unsigned char get_reason() const;
64 
66  void set_reason(unsigned char value);
67 private:
68  unsigned char _result;
69  unsigned char _source;
70  unsigned char _reason;
71 };
72 
73 }
74 
75 #endif // _b21e4f11_9337_4612_8152_b59dedc16f18
void set_reason(unsigned char value)
Set the rejection reason.
Definition: AssociationAcceptor.cpp:93
Exception reported when an incoming association is rejected.
Definition: AssociationAcceptor.h:42
void set_source(unsigned char value)
Set the rejection source.
Definition: AssociationAcceptor.cpp:79
unsigned char get_reason() const
Return the rejection reason.
Definition: AssociationAcceptor.cpp:86
void set_result(unsigned char value)
Set the rejection result.
Definition: AssociationAcceptor.cpp:65
Base class for odil exceptions.
Definition: Exception.h:19
unsigned char get_source() const
Return the rejection source.
Definition: AssociationAcceptor.cpp:72
Definition: Association.cpp:39
AssociationRejected(unsigned char result, unsigned char source, unsigned char reason, std::string const &message="Association rejected")
Constructor.
Definition: AssociationAcceptor.cpp:46
unsigned char get_result() const
Return the rejection result.
Definition: AssociationAcceptor.cpp:58