mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-26 18:42:41 +01:00
Remove trailing whitespace (#3668)
This commit is contained in:
@@ -33,7 +33,7 @@ template <class ResultType>
|
||||
class ActiveResultHolder: public RefCountedObject
|
||||
/// This class holds the result of an asynchronous method
|
||||
/// invocation. It is used to pass the result from the
|
||||
/// execution thread back to the invocation thread.
|
||||
/// execution thread back to the invocation thread.
|
||||
/// The class uses reference counting for memory management.
|
||||
/// Do not use this class directly, use ActiveResult instead.
|
||||
{
|
||||
@@ -45,26 +45,26 @@ public:
|
||||
/// Creates an ActiveResultHolder.
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
ResultType& data()
|
||||
/// Returns a reference to the actual result.
|
||||
{
|
||||
poco_check_ptr(_pData);
|
||||
return *_pData;
|
||||
}
|
||||
|
||||
|
||||
void data(ResultType* pData)
|
||||
{
|
||||
delete _pData;
|
||||
_pData = pData;
|
||||
}
|
||||
|
||||
|
||||
void wait()
|
||||
/// Pauses the caller until the result becomes available.
|
||||
{
|
||||
_event.wait();
|
||||
}
|
||||
|
||||
|
||||
bool tryWait(long milliseconds)
|
||||
/// Waits up to the specified interval for the result to
|
||||
/// become available. Returns true if the result became
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
{
|
||||
return _event.tryWait(milliseconds);
|
||||
}
|
||||
|
||||
|
||||
void wait(long milliseconds)
|
||||
/// Waits up to the specified interval for the result to
|
||||
/// become available. Throws a TimeoutException if the
|
||||
@@ -80,20 +80,20 @@ public:
|
||||
{
|
||||
_event.wait(milliseconds);
|
||||
}
|
||||
|
||||
|
||||
void notify()
|
||||
/// Notifies the invoking thread that the result became available.
|
||||
{
|
||||
_event.set();
|
||||
}
|
||||
|
||||
|
||||
bool failed() const
|
||||
/// Returns true if the active method failed (and threw an exception).
|
||||
/// Information about the exception can be obtained by calling error().
|
||||
{
|
||||
return _pExc != 0;
|
||||
}
|
||||
|
||||
|
||||
std::string error() const
|
||||
/// If the active method threw an exception, a textual representation
|
||||
/// of the exception is returned. An empty string is returned if the
|
||||
@@ -104,21 +104,21 @@ public:
|
||||
else
|
||||
return std::string();
|
||||
}
|
||||
|
||||
|
||||
Exception* exception() const
|
||||
/// If the active method threw an exception, a clone of the exception
|
||||
/// object is returned, otherwise null.
|
||||
{
|
||||
return _pExc;
|
||||
}
|
||||
|
||||
|
||||
void error(const Exception& exc)
|
||||
/// Sets the exception.
|
||||
{
|
||||
delete _pExc;
|
||||
_pExc = exc.clone();
|
||||
}
|
||||
|
||||
|
||||
void error(const std::string& msg)
|
||||
/// Sets the exception.
|
||||
{
|
||||
@@ -151,13 +151,13 @@ public:
|
||||
/// Creates an ActiveResultHolder.
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void wait()
|
||||
/// Pauses the caller until the result becomes available.
|
||||
{
|
||||
_event.wait();
|
||||
}
|
||||
|
||||
|
||||
bool tryWait(long milliseconds)
|
||||
/// Waits up to the specified interval for the result to
|
||||
/// become available. Returns true if the result became
|
||||
@@ -165,7 +165,7 @@ public:
|
||||
{
|
||||
return _event.tryWait(milliseconds);
|
||||
}
|
||||
|
||||
|
||||
void wait(long milliseconds)
|
||||
/// Waits up to the specified interval for the result to
|
||||
/// become available. Throws a TimeoutException if the
|
||||
@@ -173,20 +173,20 @@ public:
|
||||
{
|
||||
_event.wait(milliseconds);
|
||||
}
|
||||
|
||||
|
||||
void notify()
|
||||
/// Notifies the invoking thread that the result became available.
|
||||
{
|
||||
_event.set();
|
||||
}
|
||||
|
||||
|
||||
bool failed() const
|
||||
/// Returns true if the active method failed (and threw an exception).
|
||||
/// Information about the exception can be obtained by calling error().
|
||||
{
|
||||
return _pExc != 0;
|
||||
}
|
||||
|
||||
|
||||
std::string error() const
|
||||
/// If the active method threw an exception, a textual representation
|
||||
/// of the exception is returned. An empty string is returned if the
|
||||
@@ -197,21 +197,21 @@ public:
|
||||
else
|
||||
return std::string();
|
||||
}
|
||||
|
||||
|
||||
Exception* exception() const
|
||||
/// If the active method threw an exception, a clone of the exception
|
||||
/// object is returned, otherwise null.
|
||||
{
|
||||
return _pExc;
|
||||
}
|
||||
|
||||
|
||||
void error(const Exception& exc)
|
||||
/// Sets the exception.
|
||||
{
|
||||
delete _pExc;
|
||||
_pExc = exc.clone();
|
||||
}
|
||||
|
||||
|
||||
void error(const std::string& msg)
|
||||
/// Sets the exception.
|
||||
{
|
||||
@@ -234,8 +234,8 @@ private:
|
||||
template <class RT>
|
||||
class ActiveResult
|
||||
/// This class holds the result of an asynchronous method
|
||||
/// invocation (see class ActiveMethod). It is used to pass the
|
||||
/// result from the execution thread back to the invocation thread.
|
||||
/// invocation (see class ActiveMethod). It is used to pass the
|
||||
/// result from the execution thread back to the invocation thread.
|
||||
{
|
||||
public:
|
||||
typedef RT ResultType;
|
||||
@@ -247,20 +247,20 @@ public:
|
||||
{
|
||||
poco_check_ptr (pHolder);
|
||||
}
|
||||
|
||||
|
||||
ActiveResult(const ActiveResult& result)
|
||||
/// Copy constructor.
|
||||
{
|
||||
_pHolder = result._pHolder;
|
||||
_pHolder->duplicate();
|
||||
}
|
||||
|
||||
|
||||
~ActiveResult()
|
||||
/// Destroys the result.
|
||||
{
|
||||
_pHolder->release();
|
||||
}
|
||||
|
||||
|
||||
ActiveResult& operator = (const ActiveResult& result)
|
||||
/// Assignment operator.
|
||||
{
|
||||
@@ -268,30 +268,30 @@ public:
|
||||
swap(tmp);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
void swap(ActiveResult& result) noexcept
|
||||
{
|
||||
using std::swap;
|
||||
swap(_pHolder, result._pHolder);
|
||||
}
|
||||
|
||||
|
||||
ResultType& data() const
|
||||
/// Returns a reference to the result data.
|
||||
{
|
||||
return _pHolder->data();
|
||||
}
|
||||
|
||||
|
||||
void data(ResultType* pValue)
|
||||
{
|
||||
_pHolder->data(pValue);
|
||||
}
|
||||
|
||||
|
||||
void wait()
|
||||
/// Pauses the caller until the result becomes available.
|
||||
{
|
||||
_pHolder->wait();
|
||||
}
|
||||
|
||||
|
||||
bool tryWait(long milliseconds)
|
||||
/// Waits up to the specified interval for the result to
|
||||
/// become available. Returns true if the result became
|
||||
@@ -299,7 +299,7 @@ public:
|
||||
{
|
||||
return _pHolder->tryWait(milliseconds);
|
||||
}
|
||||
|
||||
|
||||
void wait(long milliseconds)
|
||||
/// Waits up to the specified interval for the result to
|
||||
/// become available. Throws a TimeoutException if the
|
||||
@@ -307,20 +307,20 @@ public:
|
||||
{
|
||||
_pHolder->wait(milliseconds);
|
||||
}
|
||||
|
||||
|
||||
bool available() const
|
||||
/// Returns true if a result is available.
|
||||
{
|
||||
return _pHolder->tryWait(0);
|
||||
}
|
||||
|
||||
|
||||
bool failed() const
|
||||
/// Returns true if the active method failed (and threw an exception).
|
||||
/// Information about the exception can be obtained by calling error().
|
||||
{
|
||||
return _pHolder->failed();
|
||||
}
|
||||
|
||||
|
||||
std::string error() const
|
||||
/// If the active method threw an exception, a textual representation
|
||||
/// of the exception is returned. An empty string is returned if the
|
||||
@@ -342,14 +342,14 @@ public:
|
||||
{
|
||||
_pHolder->notify();
|
||||
}
|
||||
|
||||
|
||||
ResultType& data()
|
||||
/// Returns a non-const reference to the result data. For internal
|
||||
/// use only.
|
||||
{
|
||||
return _pHolder->data();
|
||||
}
|
||||
|
||||
|
||||
void error(const std::string& msg)
|
||||
/// Sets the failed flag and the exception message.
|
||||
{
|
||||
@@ -361,7 +361,7 @@ public:
|
||||
{
|
||||
_pHolder->error(exc);
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
ActiveResult();
|
||||
|
||||
@@ -373,8 +373,8 @@ private:
|
||||
template <>
|
||||
class ActiveResult<void>
|
||||
/// This class holds the result of an asynchronous method
|
||||
/// invocation (see class ActiveMethod). It is used to pass the
|
||||
/// result from the execution thread back to the invocation thread.
|
||||
/// invocation (see class ActiveMethod). It is used to pass the
|
||||
/// result from the execution thread back to the invocation thread.
|
||||
{
|
||||
public:
|
||||
typedef ActiveResultHolder<void> ActiveResultHolderType;
|
||||
@@ -385,20 +385,20 @@ public:
|
||||
{
|
||||
poco_check_ptr (pHolder);
|
||||
}
|
||||
|
||||
|
||||
ActiveResult(const ActiveResult& result)
|
||||
/// Copy constructor.
|
||||
{
|
||||
_pHolder = result._pHolder;
|
||||
_pHolder->duplicate();
|
||||
}
|
||||
|
||||
|
||||
~ActiveResult()
|
||||
/// Destroys the result.
|
||||
{
|
||||
_pHolder->release();
|
||||
}
|
||||
|
||||
|
||||
ActiveResult& operator = (const ActiveResult& result)
|
||||
/// Assignment operator.
|
||||
{
|
||||
@@ -406,19 +406,19 @@ public:
|
||||
swap(tmp);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
void swap(ActiveResult& result) noexcept
|
||||
{
|
||||
using std::swap;
|
||||
swap(_pHolder, result._pHolder);
|
||||
}
|
||||
|
||||
|
||||
void wait()
|
||||
/// Pauses the caller until the result becomes available.
|
||||
{
|
||||
_pHolder->wait();
|
||||
}
|
||||
|
||||
|
||||
bool tryWait(long milliseconds)
|
||||
/// Waits up to the specified interval for the result to
|
||||
/// become available. Returns true if the result became
|
||||
@@ -426,7 +426,7 @@ public:
|
||||
{
|
||||
return _pHolder->tryWait(milliseconds);
|
||||
}
|
||||
|
||||
|
||||
void wait(long milliseconds)
|
||||
/// Waits up to the specified interval for the result to
|
||||
/// become available. Throws a TimeoutException if the
|
||||
@@ -434,20 +434,20 @@ public:
|
||||
{
|
||||
_pHolder->wait(milliseconds);
|
||||
}
|
||||
|
||||
|
||||
bool available() const
|
||||
/// Returns true if a result is available.
|
||||
{
|
||||
return _pHolder->tryWait(0);
|
||||
}
|
||||
|
||||
|
||||
bool failed() const
|
||||
/// Returns true if the active method failed (and threw an exception).
|
||||
/// Information about the exception can be obtained by calling error().
|
||||
{
|
||||
return _pHolder->failed();
|
||||
}
|
||||
|
||||
|
||||
std::string error() const
|
||||
/// If the active method threw an exception, a textual representation
|
||||
/// of the exception is returned. An empty string is returned if the
|
||||
@@ -469,7 +469,7 @@ public:
|
||||
{
|
||||
_pHolder->notify();
|
||||
}
|
||||
|
||||
|
||||
void error(const std::string& msg)
|
||||
/// Sets the failed flag and the exception message.
|
||||
{
|
||||
@@ -481,7 +481,7 @@ public:
|
||||
{
|
||||
_pHolder->error(exc);
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
ActiveResult();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user