activemq-cpp-3.9.5
BrokenBarrierException.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17#ifndef _DECAF_UTIL_CONCURRENT_BROKENBARRIEREXCEPTION_H_
18#define _DECAF_UTIL_CONCURRENT_BROKENBARRIEREXCEPTION_H_
19
21
22namespace decaf{
23namespace util{
24namespace concurrent{
25
26 /*
27 * Exception thrown when a thread tries to wait upon a barrier that is in a broken
28 * state, or which enters the broken state while the thread is waiting.
29 */
31 public:
32
37
45 : decaf::lang::Exception()
46 {
47 *(Exception*)this = ex;
48 }
49
57 : decaf::lang::Exception()
58 {
59 *(Exception*)this = ex;
60 }
61
67 BrokenBarrierException( const std::exception* cause )
68 : decaf::lang::Exception( cause ) {}
69
79 BrokenBarrierException( const char* file, const int lineNumber,
80 const char* msg, ... )
81 : decaf::lang::Exception()
82 {
83
84 va_list vargs;
85 va_start( vargs, msg );
86 buildMessage( msg, vargs );
87
88 // Set the first mark for this exception.
89 setMark( file, lineNumber );
90 }
91
102 BrokenBarrierException( const char* file, const int lineNumber,
103 const std::exception* cause,
104 const char* msg, ... )
105 : decaf::lang::Exception( cause )
106 {
107 va_list vargs ;
108 va_start( vargs, msg );
109 buildMessage( msg, vargs );
110
111 // Set the first mark for this exception.
112 setMark( file, lineNumber );
113 }
114
123 return new BrokenBarrierException( *this );
124 }
125
126 virtual ~BrokenBarrierException() throw();
127
128 };
129
130}}}
131
132#endif /*_DECAF_UTIL_CONCURRENT_BROKENBARRIEREXCEPTION_H_*/
Definition Exception.h:38
virtual void setMark(const char *file, const int lineNumber)
Adds a file/line number to the stack trace.
virtual void buildMessage(const char *format, va_list &vargs)
Exception()
Default Constructor.
BrokenBarrierException(const std::exception *cause)
Constructor.
Definition BrokenBarrierException.h:67
BrokenBarrierException(const char *file, const int lineNumber, const std::exception *cause, const char *msg,...)
Constructor - Initializes the file name and line number where this message occurred.
Definition BrokenBarrierException.h:102
BrokenBarrierException(const BrokenBarrierException &ex)
Copy Constructor.
Definition BrokenBarrierException.h:56
BrokenBarrierException(const char *file, const int lineNumber, const char *msg,...)
Constructor - Initializes the file name and line number where this message occurred.
Definition BrokenBarrierException.h:79
BrokenBarrierException()
Default Constructor.
Definition BrokenBarrierException.h:36
BrokenBarrierException(const decaf::lang::Exception &ex)
Conversion Constructor from some other Exception.
Definition BrokenBarrierException.h:44
virtual BrokenBarrierException * clone() const
Clones this exception.
Definition BrokenBarrierException.h:122
#define DECAF_API
Definition Config.h:29
Definition ThreadingTypes.h:31
Definition AbstractExecutorService.h:28
Definition AbstractCollection.h:33
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition AprPool.h:25