Changeset 266 for trunk/src/root.cc


Ignore:
Timestamp:
06/19/14 03:49:49 (11 years ago)
Author:
epyon
Message:
  • decoupling - uid_store independent of nv::object
  • decoupling - nv::object no longer linked with lua in any way
  • decoupling - gui::element related object methods moved to element
  • uid_store can operate on void* or specialized base class
  • root class no longer carries uid store nor lua state (will be removed later)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/root.cc

    r265 r266  
    1010#include "nv/lua/lua_state.hh"
    1111
    12 void nv::root::object_created( object* o )
    13 {
    14         if ( m_uid_store )
    15         {
    16                 o->m_uid = m_uid_store->insert( o );
    17         }
    18 }
    19 
    2012void nv::root::destroy_object( object* o )
    2113{
    2214        destroy_children( o );
    2315        o->detach();
    24         if ( m_lua_state && o->m_lua_index != lua::ref::none )
    25         {
    26                 m_lua_state->unregister_object( lua::ref( o->m_lua_index ) );
    27         }
    28         if ( m_uid_store && o->m_uid != 0 )
    29         {
    30                 m_uid_store->remove( o->m_uid );
    31         }
    3216        delete o;
    3317}
     
    4024        }
    4125}
    42 
    43 void nv::root::register_with_lua( object* o, const char* lua_name, const char* storage )
    44 {
    45         if ( m_lua_state )
    46         {
    47                 if ( lua_name != nullptr )
    48                 {
    49                         o->m_lua_index       = m_lua_state->register_object( o, lua_name ).get();
    50                 }
    51                 if ( storage != nullptr )
    52                 {
    53                         o->m_lua_proto_index = m_lua_state->register_proto( o->get_id().c_str(), storage ).get();
    54                 }
    55         }
    56 
    57 }
    58 
Note: See TracChangeset for help on using the changeset viewer.