/**
 * $Id$
 * $Revision$
 * $Author$
 * $Date$
 *
 * This file is part of The iWear Framework.
 * In particular this file is part of the Framework Output
 *
 * The iWear Framework is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by the
 * Free Software Foundation as in version 2 of the License.

 * 
 * The iWear Framework is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * The iWear Framework; if not, write to the Free Software Foundation, Inc., 59
 * Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#ifndef __OUTPUTDATAFUNCTORPARAMETER_H
#define __OUTPUTDATAFUNCTORPARAMETER_H

extern "C"{
#include <stdint.h>
}

// Standard includes
#include <string>

// iWear includes
#ifndef __ATOMICCOUNTER_H
#include <iwear/atomiccounter.h>
#endif

namespace iwear {
namespace output {

/**
 * This class implements a functor that is called when something has changed
 * in a TextData. Because only the text can change there is no actual
 * information in an object of this class.
 */
class OutputDataFunctorParameter{

public:
    /**
     * The Constructor for this class - please note that the given type has to
     * be equal to the type given in the OutputData this class belongs to!!!
     *
     * @param type The type of the belonging OutputData.
     */
    OutputDataFunctorParameter(const std::string& type);
    
    /**
     * Destructor for OutputDataFunctorParameter.
     */
    virtual ~OutputDataFunctorParameter(void);

    /**
     * Get the type of the output data determining the OutputModule.
     *
     * @return The type of the OutputDataFunctorParameter as a string.
     */
    inline const std::string& get_type(void) const {
	return this->type;
    }

    AtomicCounter<uint32_t>& get_counter(void) const{
	return *this->counter;
    }
    
    void set_counter(AtomicCounter<uint32_t>& counter) const{
	this->counter = &counter;
    }
private:

    /**
     * The type of the OutputDataFunctorParameter.
     */
    const std::string type;

    mutable AtomicCounter<uint32_t>* counter;
};

} // namespace output
} // namespace iwear

#endif // __OUTPUTDATAFUNCTORPARAMETER_H

