ActiveObject.h
Go to the documentation of this file.
00001 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
00002 
00003 // -- BEGIN LICENSE BLOCK ----------------------------------------------
00004 // This file is part of FZIs ic_workspace.
00005 //
00006 // This program is free software licensed under the LGPL
00007 // (GNU LESSER GENERAL PUBLIC LICENSE Version 3).
00008 // You can find a copy of this license in LICENSE folder in the top
00009 // directory of the source code.
00010 //
00011 // © Copyright 2016 FZI Forschungszentrum Informatik, Karlsruhe, Germany
00012 //
00013 // -- END LICENSE BLOCK ------------------------------------------------
00014 
00015 //----------------------------------------------------------------------
00022 //----------------------------------------------------------------------
00023 #ifndef ICL_CORE_THREAD_ACTIVE_OBJECT_H_INCLUDED
00024 #define ICL_CORE_THREAD_ACTIVE_OBJECT_H_INCLUDED
00025 
00026 #include <icl_core/List.h>
00027 
00028 #include "icl_core_thread/ActiveOperation.h"
00029 #include "icl_core_thread/ImportExport.h"
00030 #include "icl_core_thread/Mutex.h"
00031 #include "icl_core_thread/Sem.h"
00032 #include "icl_core_thread/Thread.h"
00033 
00034 #ifdef _IC_BUILDER_DEPRECATED_STYLE_
00035 # include "icl_core/Deprecate.h"
00036 #endif
00037 
00038 namespace icl_core {
00039 namespace thread {
00040 
00043 class ICL_CORE_THREAD_IMPORT_EXPORT ActiveObject : public Thread
00044 {
00045 public:
00049   ActiveObject(const icl_core::String& description,
00050                icl_core::ThreadPriority priority = 0);
00051 
00055   virtual void run();
00056 
00061   virtual void onThreadStart() { }
00062 
00067   virtual void onThreadStop() { }
00068 
00071   void stop();
00072 
00074 #ifdef _IC_BUILDER_DEPRECATED_STYLE_
00075 
00076   ICL_CORE_VC_DEPRECATE_STYLE void Stop() ICL_CORE_GCC_DEPRECATE_STYLE
00077   { stop(); }
00078 
00079 #endif
00080 
00081 
00082 protected:
00086   void queue(ActiveOperation *active_operation);
00087 
00088   icl_core::List<ActiveOperation*> m_operation_queue;
00089   Mutex m_operation_queue_mutex;
00090   Semaphore m_sem;
00091 };
00092 
00093 }
00094 }
00095 
00096 #endif


fzi_icl_core
Author(s):
autogenerated on Thu Jun 6 2019 20:22:23