47 template<
typename EnumT,
typename BitT = agx::Int64 >
52 typedef EnumT EnumType;
56 : m_bitState( BitType( 0 ) )
60 explicit BitState( BitType initialState )
61 : m_bitState( initialState )
65 ~BitState() =
default;
67 agx::Bool operator== ( EnumType state )
const
69 return m_bitState == BitType( state );
72 agx::Bool operator!= ( EnumType state )
const
74 return !( *
this == state );
79 return m_bitState == BitType( 0 );
87 BitState& set( BitType state )
93 BitState& update( EnumType state,
agx::Bool enable )
95 if ( enable )
return add( state );
96 else return remove( state );
99 BitState& add( EnumType state )
101 m_bitState |= (BitType)state;
105 BitState& remove( EnumType state )
107 m_bitState = (BitType)( m_bitState & ~state );
111 BitState& toggle( EnumType state )
113 return update( state, !Is( state ) );
118 return ( m_bitState & state ) != 0;
123 return ( m_bitState & state ) == 0;
Class for writing serialized data in binary format to a stream.
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
InputRef< T > in(const char *name, T &obj)
Create an object with a name and a reference to the object that should be restored (usually a pointer...
OutputRef< Serializable > out(const char *name, const Serializable *obj)
Return an object that contain the name and the object that should be serialized to an archive.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.