List Info

Thread: 'at' : is not a member of 'luabind::adl::object'




'at' : is not a member of 'luabind::adl::object'
user name
2007-09-21 13:02:40
Hello,

I have a lua table as follows:

-------------------------------------------------------------------------------

-- create the StateAcON state

-------------------------------------------------------------------------------
StateAcON = {}


StateAcON["Enter"] = function(AC)

  print ("[Lua]: AC is turning on...";)

end


StateAcON["Execute"] = function(AC)

    print ("[Lua]: "WOOSHHHHHHHHHHhhhhhh")   
   
    currentTemp = AC:getGlobalGameData():getRoomTemperature()
    AC:getGlobalGameData():setRoomTemperature(currentTemp - 0.3)

end

 
StateAcON["Exit"] = function(AC)

  print ("[Lua]: AC is tuning off...")

end

I have exposed a C++ class using luabind and I am trying to access one of the methods of the above table as follows:

pStateMachine->SetCurrentState(pGlobalGameData->getLuabindObject()["StateAcON"]);
...
luabind::object m_CurrentState;
...

m_CurrentState.at("Execute")(m_pOwner);

I get the following error:

'at' : is not a member of 'luabind::adl::object'

Has the at() method being changed? What is the alternative and have I provided enough information to diagnose the problem?

Thanks,
fb
Re: 'at' : is not a member of 'luabind::adl::object'
country flaguser name
United States
2007-09-21 22:52:35
You should be able to write

    m_CurrentState["Enter"](m_pOwner);

and it'll work.

- James

Frame Buffer wrote:
> Hello,
> 
> I have a lua table as follows:
> 
>
------------------------------------------------------------
-------------------
> 
> -- create the StateAcON state
> 
>
------------------------------------------------------------
-------------------
> StateAcON = {}
> 
> 
> StateAcON["Enter"] = function(AC)
> 
>   print ("[Lua]: AC is turning on...")
> 
> end
> 
> 
> StateAcON["Execute"] = function(AC)
> 
>     print ("[Lua]:
"WOOSHHHHHHHHHHhhhhhh")   
>    
>     currentTemp =
AC:getGlobalGameData():getRoomTemperature()
>    
AC:getGlobalGameData():setRoomTemperature(currentTemp -
0.3)
> 
> end
> 
>  
> StateAcON["Exit"] = function(AC)
> 
>   print ("[Lua]: AC is tuning off...")
> 
> end
> 
> I have exposed a C++ class using luabind and I am
trying to access one 
> of the methods of the above table as follows:
> 
>
pStateMachine->SetCurrentState(pGlobalGameData->getLua
bindObject()["StateAcON"]);
> ...
> luabind::object m_CurrentState;
> ...
> m_CurrentState.at("Execute")(m_pOwner);
> 
> I get the following error:
> 
> 'at' : is not a member of 'luabind::adl::object'
> 
> Has the at() method being changed? What is the
alternative and have I 
> provided enough information to diagnose the problem?
> 
> Thanks,
> fb
> 
> 
>
------------------------------------------------------------
------------
> 
>
------------------------------------------------------------
-------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> 
> 
>
------------------------------------------------------------
------------
> 
> _______________________________________________
> luabind-user mailing list
> luabind-userlists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/luabind-us
er

------------------------------------------------------------
-------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
luabind-user mailing list
luabind-userlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/luabind-us
er

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )