feisty meow concerns codebase  2.140
rendezvous.h
Go to the documentation of this file.
1 #ifndef RENDEZVOUS_CLASS
2 #define RENDEZVOUS_CLASS
3 
4 /*****************************************************************************\
5 * *
6 * Name : rendezvous *
7 * Author : Chris Koeritz *
8 * *
9 *******************************************************************************
10 * Copyright (c) 2001-$now By Author. This program is free software; you can *
11 * redistribute it and/or modify it under the terms of the GNU General Public *
12 * License as published by the Free Software Foundation; either version 2 of *
13 * the License or (at your option) any later version. This is online at: *
14 * http://www.fsf.org/copyleft/gpl.html *
15 * Please send any updates to: fred@gruntose.com *
16 \*****************************************************************************/
17 
18 #include <basis/astring.h>
19 #include <basis/contracts.h>
20 
21 namespace processes {
22 
24 
33 class rendezvous : public virtual basis::base_synchronizer
34 {
35 public:
38 
39  virtual ~rendezvous();
41 
42  DEFINE_CLASS_NAME("rendezvous");
43 
44  bool healthy() const;
46 
51 
52  bool lock(locking_methods how = ENDLESS_WAIT);
54 
57  void unlock();
59 
60  // these two methods implement the synchronizer_base interface.
61  virtual void establish_lock();
62  virtual void repeal_lock();
63 
64  const basis::astring &root_name() const;
66 
67 private:
68  void *_handle;
69  bool _locked;
70  basis::astring *_root_name;
71 };
72 
73 } //namespace.
74 
75 #endif
76 
Provides a dynamically resizable ASCII character string.
Definition: astring.h:35
Interface for a simple form of synchronization.
Definition: contracts.h:98
An inter-process synchronization primitive.
Definition: rendezvous.h:34
locking_methods
different ways that the lock() attempt can be made.
Definition: rendezvous.h:50
DEFINE_CLASS_NAME("rendezvous")
virtual void repeal_lock()
Definition: rendezvous.cpp:134
rendezvous(const basis::astring &root_name)
the healthy() method should be checked to ensure creation succeeded.
Definition: rendezvous.cpp:70
bool lock(locking_methods how=ENDLESS_WAIT)
grab the lock, if possible.
Definition: rendezvous.cpp:141
bool healthy() const
returns true if the rendezvous object is operable.
Definition: rendezvous.cpp:136
void unlock()
releases a previously acquired lock.
Definition: rendezvous.cpp:181
virtual void establish_lock()
Definition: rendezvous.cpp:132
const basis::astring & root_name() const
returns the root name passed in the constructor.
virtual ~rendezvous()
any lock held is released and the lower level structures freed.
Definition: rendezvous.cpp:98