LAMA
/home/brandes/workspace/LAMA/src/lama/SyncToken.hpp
Go to the documentation of this file.
00001 
00034 #ifndef LAMA_SYNC_TOKEN_HPP_
00035 #define LAMA_SYNC_TOKEN_HPP_
00036 
00037 // for dll_import
00038 #include <lama/config.hpp>
00039 
00040 // base classes
00041 #include <lama/NonCopyable.hpp>
00042 #include <lama/Printable.hpp>
00043 
00044 // logging
00045 #include <logging/logging.hpp>
00046 
00047 // boost
00048 #include <boost/function.hpp>
00049 
00050 #include <vector>
00051 #include <memory>
00052 
00053 namespace lama
00054 {
00055 
00056 class BaseAccess;
00057 class _LAMAArray;
00058 
00070 class LAMA_DLL_IMPORTEXPORT SyncToken : public Printable,
00071                                         private NonCopyable
00072 {
00073 public:
00074 
00077     SyncToken();
00078 
00085     virtual ~SyncToken();
00086 
00089     bool isSynchronized() const;
00090 
00093     virtual void wait() = 0;
00094 
00097     virtual bool probe() const = 0;
00098 
00101     virtual void writeAt( std::ostream& stream ) const;
00102 
00105     void pushAccess( std::auto_ptr<BaseAccess> access );
00106 
00109     void pushArray( std::auto_ptr<_LAMAArray> array );
00110 
00113     void pushSyncToken( std::auto_ptr<SyncToken> syncToken );
00114 
00115 protected:
00116 
00119     void setSynchronized();
00120 
00121     LAMA_LOG_DECL_STATIC_LOGGER(logger);  
00122 
00123 private:
00124 
00127     std::vector< BaseAccess* > mAccesses;
00128 
00129     std::vector< _LAMAArray* > mArrays;
00130 
00131     std::vector< SyncToken* > mChilds;
00132 
00133     bool mSynchronized;
00134 };
00135 
00136 }
00137 
00138 #endif // LAMA_SYNC_TOKEN_HPP_