ewmscp  ..
copyRequestTypes.h
Go to the documentation of this file.
1 #ifndef __copyRequestTypes_h__
2 #define __copyRequestTypes_h__
3 #include <enumAsBitmask.h>
4 #include <map>
5 #include <type_traits>
6 #include <waitQueues.h>
7 #include <throwcall.h>
8 
11 class fatalException: public std::logic_error {
12  protected:
13  template <typename ... Args> std::string argsToString(const Args& ... args) {
14  std::ostringstream msg;
15  throwcall::conCatString(msg, args...);
16  return msg.str();
17  }
18  public:
19  fatalException(const std::string& aWhat) : std::logic_error(aWhat) {};
20  fatalException(const char* aWhat) : std::logic_error(aWhat) {};
21  template <typename ... Args> fatalException(const Args& ... args) : std::logic_error(argsToString(args...)) {};
22  ~fatalException() override = default;
23 };
24 
25 
33  public:
34  unimplementedActionError(const std::string& aWhat) : fatalException(aWhat) {};
35  unimplementedActionError(const char* aWhat) : fatalException(aWhat) {};
36  template <typename ... Args> unimplementedActionError(const Args& ... args) : fatalException(args...) {};
37  ~unimplementedActionError() override = default;
38 };
39 
40 namespace copyRequest {
41  class base;
44 
46  typedef std::chrono::system_clock clock_type;
47 
48 
49 
50  enum class stateBitType {
51  fileToBeCopied = 1 << 0,
52  linkToBeMade = 1 << 1,
53  fileToBeRemoved = 1 << 2,
54  fileToBeRenamed = 1 << 3,
55  vanished = 1 << 4,
56  ignore = 1 << 5,
57  trucated = 1 << 6,
58  inWork = 1 << 7,
59  failed = 1 << 8,
60  done = 1 << 9,
61  append = 1 << 10,
62  attributeMismatch = 1 << 11,
65  };
66  class stateType: public enumAsBitmask<stateBitType> {
67  public:
70  };
71 
72 }; // end namespace copyRequest
73 std::ostream& operator<< (std::ostream& stream,
74  const copyRequest::clock_type::time_point& );
75 #endif
copyRequest::stateBitType
stateBitType
Definition: copyRequestTypes.h:50
copyRequest::stateBitType::attributeMismatch
@ attributeMismatch
throwcall::conCatString
void conCatString(std::ostringstream &msg, const T &begin)
Definition: throwcall.h:26
waitQueues.h
copyRequest::stateType::stateType
stateType(stateBitType aBits)
Definition: copyRequestTypes.h:69
copyRequest::stateBitType::fileToBeCopied
@ fileToBeCopied
fatalException::fatalException
fatalException(const char *aWhat)
Definition: copyRequestTypes.h:20
waitQueues::timed< copyRequest::base >
fatalException::fatalException
fatalException(const std::string &aWhat)
Definition: copyRequestTypes.h:19
copyRequest::simpleQueue
waitQueues::simple< copyRequest::base > simpleQueue
simple first-in first-out queue.
Definition: copyRequestTypes.h:41
fatalException
class for exceptions that should result in program termination
Definition: copyRequestTypes.h:11
copyRequest::timedQueue
waitQueues::timed< copyRequest::base > timedQueue
for delayed processing: returns elements when due.
Definition: copyRequestTypes.h:43
fatalException::argsToString
std::string argsToString(const Args &... args)
Definition: copyRequestTypes.h:13
copyRequest::stateBitType::inWork
@ inWork
copyRequest::stateBitType::ignore
@ ignore
unimplementedActionError
class for exceptions that result from unimplemented functions Exceptions of this kind are to be throw...
Definition: copyRequestTypes.h:32
unimplementedActionError::unimplementedActionError
unimplementedActionError(const std::string &aWhat)
Definition: copyRequestTypes.h:34
copyRequest::base
class for copy requests.
Definition: copyRequest.h:99
copyRequest::stateBitType::done
@ done
fatalException::~fatalException
~fatalException() override=default
copyRequest::stateBitType::failed
@ failed
copyRequest::stateBitType::vanished
@ vanished
copyRequest::stateType
Definition: copyRequestTypes.h:66
copyRequest::stateBitType::fileToBeRemoved
@ fileToBeRemoved
copyRequest::clock_type
std::chrono::system_clock clock_type
type for time measurements
Definition: copyRequestTypes.h:46
copyRequest::stateBitType::trucated
@ trucated
copyRequest::stateBitType::fileToBeRenamed
@ fileToBeRenamed
unimplementedActionError::~unimplementedActionError
~unimplementedActionError() override=default
unimplementedActionError::unimplementedActionError
unimplementedActionError(const char *aWhat)
Definition: copyRequestTypes.h:35
operator<<
std::ostream & operator<<(std::ostream &stream, const copyRequest::clock_type::time_point &)
Definition: copyRequest.cpp:36
throwcall.h
enumAsBitmask.h
copyRequest::stateBitType::action
@ action
copyRequest::stateBitType::noActionNeeded
@ noActionNeeded
copyRequest::stateBitType::linkToBeMade
@ linkToBeMade
waitQueues::simple< copyRequest::base >
fatalException::fatalException
fatalException(const Args &... args)
Definition: copyRequestTypes.h:21
unimplementedActionError::unimplementedActionError
unimplementedActionError(const Args &... args)
Definition: copyRequestTypes.h:36
enumAsBitmask
Definition: enumAsBitmask.h:5
copyRequest
Definition: checksumTestRequestProvider.cpp:25
copyRequest::stateBitType::append
@ append
copyRequest::stateType::stateType
stateType()
Definition: copyRequestTypes.h:68