56 lines
915 B
Plaintext
56 lines
915 B
Plaintext
// Copyright (C) 2010, Guy Barrand. All rights reserved.
|
|
// See the file tools.license for terms.
|
|
|
|
#ifndef tools_sg_action
|
|
#define tools_sg_action
|
|
|
|
#ifdef TOOLS_MEM
|
|
#include "../mem"
|
|
#endif
|
|
|
|
#include "../S_STRING"
|
|
|
|
#include <ostream>
|
|
|
|
namespace tools {
|
|
namespace sg {
|
|
|
|
class action {
|
|
//public:
|
|
TOOLS_SCLASS(tools::sg::action)
|
|
public:
|
|
//virtual void* cast(const std::string&) const = 0;
|
|
public:
|
|
action(std::ostream& a_out)
|
|
:m_out(a_out)
|
|
{
|
|
#ifdef TOOLS_MEM
|
|
mem::increment(s_class().c_str());
|
|
#endif
|
|
}
|
|
virtual ~action(){
|
|
#ifdef TOOLS_MEM
|
|
mem::decrement(s_class().c_str());
|
|
#endif
|
|
}
|
|
protected:
|
|
action(const action& a_from)
|
|
:m_out(a_from.m_out)
|
|
{
|
|
#ifdef TOOLS_MEM
|
|
mem::increment(s_class().c_str());
|
|
#endif
|
|
}
|
|
action& operator=(const action&){return *this;}
|
|
public:
|
|
std::ostream& out() const {return m_out;}
|
|
//void reset() {
|
|
//}
|
|
protected:
|
|
std::ostream& m_out;
|
|
};
|
|
|
|
}}
|
|
|
|
#endif
|