BBR 1 Ebene

Signal.h

Committer:
borlanic
Date:
2018-05-14
Revision:
0:fbdae7e6d805

File content as of revision 0:fbdae7e6d805:

/*
 * Signal.h
 * Copyright (c) 2017, ZHAW
 * All rights reserved.
 *
 *  Created on: 08.02.2017
 *      Author: Marcel Honegger
 */

#ifndef SIGNAL_H_
#define SIGNAL_H_

#include <cstdlib>
#include <stdint.h>
#include <mbed.h>

/**
 * This class manages the handling of unique signal flags to trigger rtos threads.
 */
class Signal {
    
    public:
        
                        Signal();
        virtual         ~Signal();
        virtual int32_t read();
                        operator int32_t();
        
    private:
        
        static int32_t  signals;    // variable that holds all assigned signal flags
        int32_t         signal;     // signal flag of this object
        Mutex           mutex;      // mutex to lock critical sections
};

#endif /* SIGNAL_H_ */