rename doc macros

This commit is contained in:
2021-08-04 16:31:32 +03:00
parent 0c7ce272e6
commit 25def958a1
140 changed files with 963 additions and 983 deletions

View File

@@ -1,5 +1,5 @@
/*! \file pigrabberbase.h
* \brief Abstract class for create grabbers
/*! @file pigrabberbase.h
* @brief Abstract class for create grabbers
*/
/*
PIP - Platform Independent Primitives

View File

@@ -18,7 +18,7 @@
*/
/** \class PIMutex
* \brief Mutex
* @brief Mutex
* \details
* \section PIMutex_sec0 Synopsis
* %PIMutex provides synchronization blocks between several threads.

View File

@@ -1,5 +1,5 @@
/*! \file pimutex.h
* \brief PIMutex, PIMutexLocker
/*! @file pimutex.h
* @brief PIMutex, PIMutexLocker
*/
/*
PIP - Platform Independent Primitives
@@ -39,16 +39,16 @@ public:
~PIMutex();
//! \brief Lock mutex
//! @brief Lock mutex
//! \details If mutex is unlocked it set to locked state and returns immediate.
//! If mutex is already locked function blocks until mutex will be unlocked
void lock();
//! \brief Unlock mutex
//! @brief Unlock mutex
//! \details In any case this function returns immediate
void unlock() ;
//! \brief Try to lock mutex
//! @brief Try to lock mutex
//! \details If mutex is unlocked it set to locked state and returns "true" immediate.
//! If mutex is already locked function returns immediate an returns "false"
bool tryLock();
@@ -64,7 +64,7 @@ private:
};
//! \brief PIMutexLocker
//! @brief PIMutexLocker
//! \details Same as std::lock_guard<std::mutex>.
//! When a PIMutexLocker object is created, it attempts to lock the mutex it is given, if "condition" true.
//! When control leaves the scope in which the PIMutexLocker object was created,

View File

@@ -1,5 +1,5 @@
/*! \file pipipelinethread.h
* \brief Class for create multihread pipeline
/*! @file pipipelinethread.h
* @brief Class for create multihread pipeline
*/
/*
PIP - Platform Independent Primitives

View File

@@ -18,7 +18,7 @@
*/
/** \class PISpinlock
* \brief Spinlock
* @brief Spinlock
* \details
* \section PISpinlock_sec0 Synopsis
* %PISpinlock provides synchronization blocks between several threads.

View File

@@ -1,5 +1,5 @@
/*! \file pispinlock.h
* \brief PISpinlock
/*! @file pispinlock.h
* @brief PISpinlock
*/
/*
PIP - Platform Independent Primitives
@@ -39,12 +39,12 @@ public:
~PISpinlock() {}
//! \brief Lock spinlock
//! @brief Lock spinlock
//! \details If spinlock is unlocked it set to locked state and returns immediate.
//! If spinlock is already locked function blocks until spinlock will be unlocked
void lock() {while (flag.test_and_set(std::memory_order_acquire));}
//! \brief Unlock spinlock
//! @brief Unlock spinlock
//! \details In any case this function returns immediate
void unlock() {flag.clear(std::memory_order_release);}
@@ -54,7 +54,7 @@ private:
};
//! \brief PISpinlockLocker
//! @brief PISpinlockLocker
//! \details
//! When a PISpinlockLocker object is created, it attempts to lock the spinlock it is given, if "condition" true.
//! When control leaves the scope in which the PISpinlockLocker object was created,

View File

@@ -42,7 +42,7 @@ __THREAD_FUNC_RET__ thread_function_once(void * t) {((PIThread*)t)->__thread_fun
/*! \class PIThread
* \brief Thread class
* @brief Thread class
* \details This class allow you exec your code in separate thread.
*
* \section PIThread_sec0 Synopsis

View File

@@ -1,5 +1,5 @@
/*! \file pithread.h
* \brief Thread
/*! @file pithread.h
* @brief Thread
*
* This file declare thread class and some wait functions
*/
@@ -101,25 +101,25 @@ public:
EVENT_HANDLER1(void, stop, bool, wait);
EVENT_HANDLER0(void, terminate);
//! \brief Set common data passed to external function
//! @brief Set common data passed to external function
void setData(void * d) {data_ = d;}
//! \brief Set external function that will be executed after every \a run()
//! @brief Set external function that will be executed after every \a run()
void setSlot(ThreadFunc func) {ret_func = func;}
//! \brief Set external function that will be executed after every \a run()
//! @brief Set external function that will be executed after every \a run()
void setSlot(std::function<void()> func) {ret_func = [func](void*){func();};}
//! \brief Set priority of thread
//! @brief Set priority of thread
void setPriority(PIThread::Priority prior);
//! \brief Returns common data passed to external function
//! @brief Returns common data passed to external function
void * data() const {return data_;}
//! \brief Return priority of thread
//! @brief Return priority of thread
PIThread::Priority priority() const {return priority_;}
//! \brief Return \c true if thread is running
//! @brief Return \c true if thread is running
bool isRunning() const {return running_;}
bool isStopping() const {return running_ && terminating;}
@@ -129,15 +129,15 @@ public:
EVENT_HANDLER0(bool, waitForFinish) {return waitForFinish(-1);}
EVENT_HANDLER1(bool, waitForFinish, int, timeout_msecs);
//! \brief Set necessity of lock every \a run with internal mutex
//! @brief Set necessity of lock every \a run with internal mutex
void needLockRun(bool need) {lockRun = need;}
EVENT_HANDLER0(void, lock) {mutex_.lock();}
EVENT_HANDLER0(void, unlock) {mutex_.unlock();}
//! \brief Returns internal mutex
//! @brief Returns internal mutex
PIMutex & mutex() {return mutex_;}
//! \brief Returns thread ID
//! @brief Returns thread ID
llong tid() const {return tid_;}
void __thread_func__();
@@ -146,12 +146,12 @@ public:
EVENT(started)
EVENT(stopped)
//! \brief Start event handler with name \"handler\" of object \"object\"
//! @brief Start event handler with name \"handler\" of object \"object\"
//! in separate thread with name \"name\"
//! and automatically delete it on function finish
static void runOnce(PIObject * object, const char * handler, const PIString & name = PIString());
//! \brief Start function \"func\" in separate thread with name \"name\"
//! @brief Start function \"func\" in separate thread with name \"name\"
//! and automatically delete it on function finish
static void runOnce(std::function<void()> func, const PIString & name = PIString());
@@ -159,7 +159,7 @@ public:
//! \{
/** \fn bool start(int timer_delay = -1)
* \brief Start thread
* @brief Start thread
* \details Start execution of \a run() in internal loop with
* "timer_delay" delay in milliseconds. If "timer_delay" <= 0
* there is no delay in loop. Thread also exec external function
@@ -168,58 +168,58 @@ public:
* \return \c false if thread already started or can`t start thread */
/** \fn bool startOnce()
* \brief Start thread without internal loop
* @brief Start thread without internal loop
* \details Start execution of \a run() once. Thread also exec
* external function set by \a setSlot() if it`s not null
*
* \return \c false if thread already started or can`t start thread */
/** \fn bool startOnce(ThreadFunc func)
* \brief Start thread without internal loop
* @brief Start thread without internal loop
* \details Overloaded function. Set external function "func" before start
*
* \return \c false if thread already started or can`t start thread */
/** \fn void stop(bool wait = false)
* \brief Stop thread
* @brief Stop thread
* \details Stop execution of thread and wait for it finish
* if "wait" is \c true. This function can block for infinite
* time if "wait" is \c true and any of thread function is
* busy forever */
/** \fn void terminate()
* \brief Strongly stop thread
* @brief Strongly stop thread
* \details Stop execution of thread immediately */
/** \fn bool waitForStart(int timeout_msecs = -1)
* \brief Wait for thread start
* @brief Wait for thread start
* \details This function block until thread start for "timeout_msecs"
* or forever if "timeout_msecs" < 0
*
* \return \c false if timeout is exceeded */
/** \fn bool waitForFinish(int timeout_msecs = -1)
* \brief Wait for thread finish
* @brief Wait for thread finish
* \details This function block until thread finish for "timeout_msecs"
* or forever if "timeout_msecs" < 0
*
* \return \c false if timeout is exceeded */
//! \fn void lock()
//! \brief Lock internal mutex
//! @brief Lock internal mutex
//! \fn void unlock()
//! \brief Unlock internal mutex
//! @brief Unlock internal mutex
//! \}
//! \events
//! \{
//! \fn void started()
//! \brief Raise on thread start
//! @brief Raise on thread start
//! \fn void stopped()
//! \brief Raise on thread stop
//! @brief Raise on thread stop
//! \}

View File

@@ -25,7 +25,7 @@
/*! \class PITimer
* \brief Timer
* @brief Timer
*
* \section PITimer_sec0 Synopsis
* This class implements timer function. PIP timers supports 3 way to tick notify,

View File

@@ -1,5 +1,5 @@
/*! \file pitimer.h
* \brief Timer
/*! @file pitimer.h
* @brief Timer
*/
/*
PIP - Platform Independent Primitives
@@ -39,7 +39,7 @@ public:
double interval() const {return interval_;}
void setInterval(double i);
//! \brief Return \c true if thread is running
//! @brief Return \c true if thread is running
bool isRunning() const {return running_;}
bool isStopped() const {return !running_;}
@@ -76,10 +76,10 @@ class PIP_EXPORT PITimer: public PIObject {
public:
NO_COPY_CLASS(PITimer)
//! \brief Constructs timer with PITimer::Thread implementation
//! @brief Constructs timer with PITimer::Thread implementation
explicit PITimer();
//! \brief Timer implementations
//! @brief Timer implementations
enum TimerImplementation {
Thread /*! Timer works in his own thread. Intervals are measured by the system time */ = 0x01,
ThreadRT /*! Using POSIX timer with SIGEV_THREAD notification. \attention Doesn`t support on Windows and Mac OS! */ = 0x02,
@@ -87,34 +87,34 @@ public:
* sequentially executes all timers. \attention Use this implementation with care! */ = 0x04
};
//! \brief Constructs timer with "ti" implementation
//! @brief Constructs timer with "ti" implementation
explicit PITimer(TimerImplementation ti);
//! \brief Constructs timer with "slot" slot void(void *,int), "data" data and "ti" implementation
//! @brief Constructs timer with "slot" slot void(void *,int), "data" data and "ti" implementation
explicit PITimer(TimerEvent slot, void * data = 0, TimerImplementation ti = Thread);
//! \brief Constructs timer with "slot" slot void(), and "ti" implementation
//! @brief Constructs timer with "slot" slot void(), and "ti" implementation
explicit PITimer(std::function<void ()> slot, TimerImplementation ti = Thread);
//! \brief Constructs timer with "slot" slot void(void *), "data" data and "ti" implementation
//! @brief Constructs timer with "slot" slot void(void *), "data" data and "ti" implementation
explicit PITimer(std::function<void (void *)> slot, void * data, TimerImplementation ti = Thread);
virtual ~PITimer();
//! \brief Returns timer implementation
//! @brief Returns timer implementation
PITimer::TimerImplementation implementation() const {return imp_mode;}
//! \brief Returns timer loop delay in milliseconds
//! @brief Returns timer loop delay in milliseconds
double interval() const;
//! \brief Set timer loop delay in milliseconds
//! @brief Set timer loop delay in milliseconds
EVENT_HANDLER1(void, setInterval, double, ms);
//! \brief Returns if timer is started
//! @brief Returns if timer is started
bool isRunning() const;
//! \brief Returns if timer is not started
//! @brief Returns if timer is not started
bool isStopped() const;
EVENT_HANDLER0(bool, start);
@@ -123,22 +123,22 @@ public:
EVENT_HANDLER0(bool, restart);
/** \brief Start timer with \b interval() loop delay after \b delay_msecs delay.
/** @brief Start timer with \b interval() loop delay after \b delay_msecs delay.
* \details Timer wait \b delay_msecs milliseconds and then normally starts with
* \b interval() loop delay. */
void startDeferred(double delay_ms);
/** \brief Start timer with \b interval_msecs loop delay after \b delay_msecs delay.
/** @brief Start timer with \b interval_msecs loop delay after \b delay_msecs delay.
* \details Timer wait \b delay_msecs milliseconds and then normally starts with
* \b interval_msecs loop delay. */
void startDeferred(double interval_ms, double delay_ms);
/** \brief Start timer with \b interval() loop delay after \b start_datetime date and time.
/** @brief Start timer with \b interval() loop delay after \b start_datetime date and time.
* \details Timer wait until \b start_datetime and then normally starts with
* \b interval() loop delay. */
void startDeferred(PIDateTime start_datetime);
/** \brief Start timer with \b interval_msecs loop delay after \b start_datetime date and time.
/** @brief Start timer with \b interval_msecs loop delay after \b start_datetime date and time.
* \details Timer wait until \b start_datetime and then normally starts with
* \b interval_msecs loop delay. */
void startDeferred(double interval_ms, PIDateTime start_datetime);
@@ -148,43 +148,43 @@ public:
bool waitForFinish() {return waitForFinish(-1);}
bool waitForFinish(int timeout_msecs);
//! \brief Set custom data
//! @brief Set custom data
void setData(void * data_) {data_t = data_;}
//! \brief Set timer tick function
//! @brief Set timer tick function
void setSlot(TimerEvent slot) {ret_func = slot;}
//! \brief Set timer tick function
//! @brief Set timer tick function
void setSlot(std::function<void ()> slot) {ret_func = [slot](void *, int){slot();};}
//! \brief Set timer tick function
//! @brief Set timer tick function
void setSlot(std::function<void (void *)> slot) {ret_func = [slot](void *d, int){slot(d);};}
//! \brief Returns common data passed to tick functions
//! @brief Returns common data passed to tick functions
void * data() const {return data_t;}
void needLockRun(bool need) {lockRun = need;}
EVENT_HANDLER0(void, lock) {mutex_.lock();}
EVENT_HANDLER0(void, unlock) {mutex_.unlock();}
//! \brief Returns if timer should exec \a maybeCallQueuedEvents() at every tick.
//! @brief Returns if timer should exec \a maybeCallQueuedEvents() at every tick.
//! By default \b true
bool isCallQueuedEvents() const {return callEvents;}
//! \brief If set timer exec \a maybeCallQueuedEvents() at every tick.
//! @brief If set timer exec \a maybeCallQueuedEvents() at every tick.
//! By default \b true
void setCallQueuedEvents(bool yes) {callEvents = yes;}
//! \brief Add frequency delimiter \b delim with optional delimiter slot \b slot.
//! @brief Add frequency delimiter \b delim with optional delimiter slot \b slot.
void addDelimiter(int delim, TimerEvent slot = 0) {delims << Delimiter(slot, delim);}
//! \brief Add frequency delimiter \b delim with optional delimiter slot \b slot.
//! @brief Add frequency delimiter \b delim with optional delimiter slot \b slot.
void addDelimiter(int delim, std::function<void ()> slot) {delims << Delimiter([slot](void *, int){slot();}, delim);}
//! \brief Add frequency delimiter \b delim with optional delimiter slot \b slot.
//! @brief Add frequency delimiter \b delim with optional delimiter slot \b slot.
void addDelimiter(int delim, std::function<void (void *)> slot) {delims << Delimiter([slot](void *d, int){slot(d);}, delim);}
//! \brief Remove all frequency delimiters \b delim.
//! @brief Remove all frequency delimiters \b delim.
void removeDelimiter(int delim) {for (int i = 0; i < delims.size_s(); ++i) if (delims[i].delim == delim) {delims.remove(i); i--;}}
EVENT_HANDLER0(void, clearDelimiters) {delims.clear();}
@@ -195,30 +195,30 @@ public:
//! \{
/** \fn bool start()
* \brief Start timer with \a interval() loop delay
* @brief Start timer with \a interval() loop delay
* \details Start execution of timer functions with frequency = 1 / msecs Hz. */
/** \fn bool start(double msecs)
* \brief Start timer with \b msecs loop delay
* @brief Start timer with \b msecs loop delay
* \details Start execution of timer functions with frequency = 1. / msecs Hz.
* Instead of \a start(int msecs) function this variant allow start timer
* with frequencies more than 1 kHz */
//! \fn bool restart()
//! \brief Stop and start timer with \a interval() loop delay
//! @brief Stop and start timer with \a interval() loop delay
//! \fn bool stop(bool wait = true)
//! \brief Stop timer and wait for it finish if "wait"
//! @brief Stop timer and wait for it finish if "wait"
//! \fn void clearDelimiters()
//! \brief Remove all frequency delimiters
//! @brief Remove all frequency delimiters
//! \}
//! \events
//! \{
/** \fn void tickEvent(void * data, int delimiter)
* \brief Raise on timer tick
* @brief Raise on timer tick
* \details \b Data can be set with function \a setData(void * data) or from constructor.
* \b Delimiter is frequency delimiter, 1 for main loop. */