sync_ptr Class Template Reference
Inheritance diagram for sync_ptr:
List of all members.
template<class T, class SYNC_T = sync_ctrl_default, class AX_TYPE = std::allocator<T>, class AX_SYNC_CTRL = std::allocator<SYNC_T>>
sync_ptr is a portable synchronized smart pointer.
class sync_ptr< T, SYNC_T, AX_TYPE, AX_SYNC_CTRL >
- David Maisonave (Axter) (609-345-1007) (http://axter.com)
Copyright (C) 2005
sync_ptr is a thread safe pointer. sync_ref_ptr is a reference counting (shared_ptr) derived version of sync_ptr sync_ptr and sync_ref_ptr can be used with Windows or UNIX/Linux via, WIN32 API's or POSIX functions. They can turn any object into a thread safe object. sync_ptr destructor will automatically destroy the object, so the object can be create via new on sync_ptr constructor. This insures no other process has ownership of the object.
sync_ptr<vector<int> > MyThreadSafeVectorInt(new vector<int>, new sync_ctrl_default);
cout << MyThreadSafeVectorInt->at(0) << endl;
An instance of RefLockPtr can be create to lock the object for the duration of a function.
sync_ptr<string> MyThreadSafeString(new string);
sync_ptr<string>::RefLockPtr MyLockedString = MyThreadSafeString.get_locked_obj();
The destructor for RefLockPtr automatically unlocks the object, so an explicit unlock call
is not required.
Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies. David Maisonave (Axter) makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
Definition at line 52 of file sync_ptr.hpp.
The documentation for this class was generated from the following file:
Generated on Wed Mar 29 21:58:59 2006 for Smart Pointers by