Ignore:
Timestamp:
07/15/13 20:13:27 (12 years ago)
Author:
epyon
Message:
  • flags - flags support, essentially a std::bitset implementation with .data() method and enum class support
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/nv/lua/lua_state.hh

    r121 r162  
    1111#include <map>
    1212#include <nv/common.hh>
     13#include <nv/flags.hh>
    1314#include <string>
    1415
     
    5253                        double get_double( const std::string& element, double defval = 0.0 );
    5354                        bool get_boolean( const std::string& element, bool defval = false );
    54                 public:
     55
     56                        template< uint32 SIZE, typename T >
     57                        flags< SIZE, T > get_flags( const std::string& element )
     58                        {
     59                                flags< SIZE, T > result;
     60                                get_raw_flags( element, result.data(), result.size() );
     61                                return result;
     62                        }
     63
     64                        template< uint32 SIZE, typename T >
     65                        void load_flags( const std::string& element, flags< SIZE, T >& flags )
     66                        {
     67                                get_raw_flags( element, flags.data(), flags.size() );
     68                        }
     69                private:
     70                        void get_raw_flags( const std::string& element, uint8* data, uint32 count );
     71
    5572                        state* L;
    5673                        stack_guard m_guard;
Note: See TracChangeset for help on using the changeset viewer.