const int a_id;
const int a_value;
- void run () throw (RuntimeException);
+ void run () noexcept(false);
anna_complete_runnable (Client);
};
class SOAP {
public:
- static int theMethod (const int id, const int value) throw (RuntimeException);
+ static int theMethod (const int id, const int value) noexcept(false);
};
class Receiver;
class Waiter {
public:
- int getId () const throw () { return a_id; }
- int getValue () const throw () { return a_value; }
+ int getId () const { return a_id; }
+ int getValue () const { return a_value; }
- void setId (const int id) throw () { a_id = id; }
- void setValue (const int value) throw () { a_value = value; }
+ void setId (const int id) { a_id = id; }
+ void setValue (const int value) { a_value = value; }
- void sendRequest () throw (RuntimeException);
- int waitResponse () throw (RuntimeException);
- void notifyResponse (const int result) throw (RuntimeException);
+ void sendRequest () noexcept(false);
+ int waitResponse () noexcept(false);
+ void notifyResponse (const int result) noexcept(false);
- void initialize () throw (RuntimeException);
+ void initialize () noexcept(false);
private:
static const int ReadChannel = 0;
class Context : public SafeRecycler <Waiter> {
public:
- Waiter* createWaiter (const int id, const int value) throw (RuntimeException);
- void destroyWaiter (Waiter* waiter) throw (RuntimeException);
- Waiter* findWaiter (const int id) throw () { return a_waiters.find (id); }
+ Waiter* createWaiter (const int id, const int value) noexcept(false);
+ void destroyWaiter (Waiter* waiter) noexcept(false);
+ Waiter* findWaiter (const int id) { return a_waiters.find (id); }
private:
struct SortByID {
- static int value (const Waiter* waiter) throw () { return waiter->getId (); }
+ static int value (const Waiter* waiter) { return waiter->getId (); }
};
typedef SortedVector <Waiter, SortByID, int> waiter_container;
int a_id;
int a_value;
- void run () throw (RuntimeException);
+ void run () noexcept(false);
anna_complete_runnable (Waiter);
};
// Esto simula el proceso cliente que envía la petición al proceso gSOAP
/* Se ejecuta desde el thread Tx */
void Client::run ()
- throw (RuntimeException)
+ noexcept(false)
{
int result = SOAP::theMethod (a_id, a_value);
// que será el que le dé la respuesta "real" en algún momento.
/* Tx */
int SOAP::theMethod (const int id, const int value)
- throw (RuntimeException)
+ noexcept(false)
{
int result = -1;
/* Tx */
void Waiter::initialize ()
- throw (RuntimeException)
+ noexcept(false)
{
if (pipe (a_pipe) == -1) {
string msg (functions::asText ("Waiter::initialize | Id: ", a_id));
/* Tx */
void Waiter::sendRequest ()
- throw (RuntimeException)
+ noexcept(false)
{
try {
/* Ojo que esto generará memory-leaks, pero no es el objeto de éste ejemplo la buena gestión de la memoria */
/* Tx */
int Waiter::waitResponse ()
- throw (RuntimeException)
+ noexcept(false)
{
bool receive = io::functions::waitInput (a_pipe [ReadChannel], (Millisecond)500);
/* Ty */
void Waiter::notifyResponse (const int result)
- throw (RuntimeException)
+ noexcept(false)
{
int byte = 0;
// que debería haber un Waiter esperando.
/* Ty */
void Receiver::run ()
- throw (RuntimeException)
+ noexcept(false)
{
anna::functions::sleep ((Millisecond)(rand () % 1000));
}
Waiter* Context::createWaiter (const int id, const int value)
- throw (RuntimeException)
+ noexcept(false)
{
Guard guard (*this, "Context::createWaiter");
}
void Context::destroyWaiter (Waiter* waiter)
- throw (RuntimeException)
+ noexcept(false)
{
Guard guard (this, "Context::destroyWaiter");