I'm absolutely lost at trying to port the Richard Lord's Ash Framework to "pure" C++ (MSVC Express 2008) or at least i hasnt been able to find any implementation alike, I'm messing with the boost:fusion libs to implement the minimun reflection requirements that the frameworks require but template metaprograming comes as new for me and I'm overflow with compiler errors and time-consuming failure testing :( ...
Anyone knows about the feasibility or usefulness to port the framework?
Taking the Entity class as example, could someone clarify how could i achieve a result like :
(THIS IS FLEX CODE!)
waitEntity = new Entity( "wait" )
.add( new WaitForStart( waitView ) )
.add( new Display( waitView ) )
.add( new Position( 0, 0, 0 ) );
with an C++ implementaton like this?
...
namespace bf = boost::fusion;
namespace bm = boost::mpl;
template<typename ComponentMap>
class EntityASH{
public:
EntityASH(ComponentMap c)
:m_components(c){ }
//"fusion-style" trying to return a new Components template entity for a new component type
template<typename T>
EntityASH
template<typename T>
/*¿Here im absoltely lost
EntityASH<
result_of::as_map<
typename result_of::push_back<ComponentMap,
fusion::pair<T,T>
>::type
>
>*/
EntityASH *add(){
typedef bf::pair<T, T> newTentryPair;
//bf::as_map(bf::push_back<ComponentMap,newTentryPair>(m_components,newTentryPair()));
return new EntityASH(bf::as_map(bf::push_back<ComponentMap,newTentryPair>(m_components,newTentryPair())));
...