Changeset 7:a3d84407fb9a in xplcommon for src/xplcommon


Ignore:
Timestamp:
12/29/12 07:45:57 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Added the public interfaces

Location:
src/xplcommon
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/xplcommon/Thread.h

    r3 r7  
    3232//------------------------------------------------------------------------------
    3333
     34// The public interface of the Thread class common to all platforms
     35#if 0
     36
     37//------------------------------------------------------------------------------
     38
     39namespace xplcommon {
     40
     41//------------------------------------------------------------------------------
     42
     43/**
     44 * A thread
     45 */
     46class Thread
     47{
     48public:
     49    /**
     50     * Virtual destructor.
     51     */
     52    virtual ~Thread();
     53
     54    /**
     55     * Start the thread.
     56     *
     57     * @return if the thread could be started
     58     */
     59    bool start();
     60
     61    /**
     62     * Perform the thread's real operation. To be implemented in children
     63     */
     64    virtual void run() = 0;
     65
     66    /**
     67     * Wait for the thread to quit.
     68     */
     69    void join();
     70};
     71
     72//------------------------------------------------------------------------------
     73
     74#endif // 0, The public interface of the Thread class common to all platforms
     75
     76//------------------------------------------------------------------------------
     77
    3478#include "config.h"
    3579
  • src/xplcommon/WaitableEvent.h

    r4 r7  
    3030#ifndef XPLCOMMON_WAITABLEEVENT_H
    3131#define XPLCOMMON_WAITABLEEVENT_H
     32//------------------------------------------------------------------------------
     33
     34// The public interface of the WaitableEvent class common to all platforms
     35#if 0
     36
     37//------------------------------------------------------------------------------
     38
     39namespace xplcommon {
     40
     41//------------------------------------------------------------------------------
     42
     43/**
     44 * An event on which one can wait with a waiter.
     45 */
     46class WaitableEvent : public Waitable
     47{
     48public:
     49    /**
     50     * Construct the event.
     51     */
     52    WaitableEvent(Waiter* waiter = 0);
     53
     54    /**
     55     * Destroy the event.
     56     */
     57    virtual ~WaitableEvent();
     58
     59    /**
     60     * Fire the event.
     61     */
     62    void fire();
     63
     64    /**
     65     * Check if the event is fired or not. If so, the fired status
     66     * will be cleared.
     67     */
     68    bool check();
     69};
     70
     71//------------------------------------------------------------------------------
     72
     73} /* namespace xplcommon */
     74
     75//------------------------------------------------------------------------------
     76
     77#endif // 0, // The public interface of the WaitableEvent class common to all platforms
     78
    3279//------------------------------------------------------------------------------
    3380
  • src/xplcommon/Waiter.h

    r4 r7  
    3030#ifndef XPLCOMMON_WAITER_H
    3131#define XPLCOMMON_WAITER_H
     32//------------------------------------------------------------------------------
     33
     34// The public interface of the Waiter class common to all platforms
     35#if 0
     36
     37//------------------------------------------------------------------------------
     38
     39namespace xplcommon {
     40
     41//------------------------------------------------------------------------------
     42
     43/**
     44 * Class that can be used to register waitable objects and then wait
     45 * for them. The objects are registered when they created and a Waiter
     46 * instance is passed to them.
     47 */
     48class Waiter
     49{
     50public:
     51    /**
     52     * Wait for any if the waitables to become ready or until a
     53     * timeout expires.
     54     *
     55     * If any of the waitables are ready, the function returns immediately.
     56     *
     57     * @return true if any of the waitables has become ready, false if
     58     * the timeout occurs.
     59     */
     60    bool wait(int timeout = -1);
     61};
     62
     63//------------------------------------------------------------------------------
     64
     65} /* namespace xplcommon */
     66
     67//------------------------------------------------------------------------------
     68
     69#endif // 0, The public interface of the Waiter class common to all platforms
     70
    3271//------------------------------------------------------------------------------
    3372
Note: See TracChangeset for help on using the changeset viewer.