Сейчас так:
////////////////////////////////////////////////////////////////////////////////
MAIN.CPP:
#include "sys.hpp"
Csys sysA;
int _tmain(int argc, _TCHAR* argv[])
{
sysA.inputs_handler();
}
////////////////////////////////////////////////////////////////////////////////
SYS.CPP
#include "sys.hpp"
#include "stdafx.h"
/////////////
Csys::Csys()
{
}
/////////////
void Csys::inputs_handler( void )
{
fltr1.read_input( true );
}
/////////////
void Csys::out_func( void )
{
}
////////////////////////////////////////////////////////////////////////////////
SYS.HPP
#ifndef SYS_HPP
#define SYS_HPP
#include "fltr.hpp"
/////////////
class Csys
{
private:
public:
Csys();
Cfltr fltr1;
void inputs_handler( void );
void out_func( void );
};
#endif
////////////////////////////////////////////////////////////////////////////////
FLTR.CPP
#include "fltr.hpp"
#include "stdafx.h"
/////////////
Cfltr::Cfltr()
{
}
/////////////
void Cfltr::set_callback_func_ptr( void )
{
callback_func_ptr = Csys::out_func;
}
/////////////
void Cfltr::read_input( bool in_state )
{
}
////////////////////////////////////////////////////////////////////////////////
FLTR.HPP
#ifndef FLTR_HPP
#define FLTR_HPP
class Csys; // predefinition
///////////////////////////////////////////////////////////////////////////////
class Cfltr
{
private:
public:
Cfltr();
void (Csys::*callback_func_ptr)();
void set_callback_func_ptr();
void read_input( bool in_state );
};
#endif
Можно ли Вас попросить просто нарисовать без обьяснений следующее:
вызывается
sysA.inputs_handler();
который вызывает sysA.fltr1.read_input();
и тот в свою очередь вызывает sysA.out_func();