- Main Page
- Namespaces
- Classes
- Files
- Related Pages

# /Users/fpy/titan-1-5-MBARI/Mers/Utils/Lang/ReferencedObject.h

    00001
    00002 //
    00003 // Copyright (c) 2004           Model-based Embedded and Robotic Systems Group
    00004 // All Rights Reserved          Massachusetts Institute of Technology
    00005 //
    00006 // This software is provided as is. Model-based Embedded and Robotic Systems
    00007 // (MERS) group does not assume any responsibility.
    00008 //
    00009 // Organization:        Model-based Embedded and Robotic Systems Group
    00010 //                                      Massachusetts Institute of Technology
    00011 //
    00013
    00014 #ifndef REFERENCED_OBJECT_HEADERFILE
    00015 #define REFERENCED_OBJECT_HEADERFILE
    00016
    00017 #include <pthread.h>
    00018
    00019 namespace Mers {
    00020         namespace Utils {
    00021                 namespace Lang {
    00022
    00042                         class ReferencedObject
    00043                         {
    00044                         public:
    00048                                 ReferencedObject();
    00049
    00053                                 virtual ~ReferencedObject();
    00054
    00059                                 virtual void addReference();
    00060
    00065                                 virtual void removeReference();
    00066
    00067                         protected:
    00073                                 virtual void lockReferencedObject();
    00074
    00080                                 virtual void unlockReferencedObject();
    00081
    00082                         protected:
    00084                                 unsigned int mNumberOfReferences;
    00085
    00088                                 pthread_mutex_t mReferencedObjectMutex;
    00089                         };
    00090
    00091                 }
    00092         }
    00093 }
    00094
    00095 #endif // REFERENCED_OBJECT_HEADERFILE
    00096