]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - libs/entitylib.h
various: drop dead code
[xonotic/netradiant.git] / libs / entitylib.h
index 7f1bb0c1c355163e625124aeaaa04ee458b880fe..326f2c7c6c9939f273ef160531e5117f1046fd96 100644 (file)
@@ -293,80 +293,80 @@ void render( RenderStateFlags state ) const {
 /// - Provides undo support through the global undo system.
 class KeyValue : public EntityKeyValue
 {
-typedef UnsortedSet<KeyObserver> KeyObservers;
-
-std::size_t m_refcount;
-KeyObservers m_observers;
-CopiedString m_string;
-const char* m_empty;
-ObservedUndoableObject<CopiedString> m_undo;
-static EntityCreator::KeyValueChangedFunc m_entityKeyValueChanged;
-public:
+       typedef UnsortedSet<KeyObserver> KeyObservers;
 
-KeyValue( const char* string, const char* empty )
-       : m_refcount( 0 ), m_string( string ), m_empty( empty ), m_undo( m_string, UndoImportCaller( *this ) ){
-       notify();
-}
-~KeyValue(){
-       ASSERT_MESSAGE( m_observers.empty(), "KeyValue::~KeyValue: observers still attached" );
-}
+       std::size_t m_refcount;
+       KeyObservers m_observers;
+       CopiedString m_string;
+       const char* m_empty;
+       ObservedUndoableObject<CopiedString> m_undo;
+       static EntityCreator::KeyValueChangedFunc m_entityKeyValueChanged;
 
-static void setKeyValueChangedFunc( EntityCreator::KeyValueChangedFunc func ){
-       m_entityKeyValueChanged = func;
-}
+public:
+       KeyValue( const char* string, const char* empty )
+               : m_refcount( 0 ), m_string( string ), m_empty( empty ), m_undo( m_string, UndoImportCaller( *this ) ){
+               notify();
+       }
+       ~KeyValue(){
+               ASSERT_MESSAGE( m_observers.empty(), "KeyValue::~KeyValue: observers still attached" );
+       }
 
-void IncRef(){
-       ++m_refcount;
-}
-void DecRef(){
-       if ( --m_refcount == 0 ) {
-               delete this;
+       static void setKeyValueChangedFunc( EntityCreator::KeyValueChangedFunc func ){
+               m_entityKeyValueChanged = func;
        }
-}
 
-void instanceAttach( MapFile* map ){
-       m_undo.instanceAttach( map );
-}
-void instanceDetach( MapFile* map ){
-       m_undo.instanceDetach( map );
-}
+       void IncRef(){
+               ++m_refcount;
+       }
+       void DecRef(){
+               if ( --m_refcount == 0 ) {
+                       delete this;
+               }
+       }
 
-void attach( const KeyObserver& observer ){
-       ( *m_observers.insert ( observer ) )( c_str() );
-}
-void detach( const KeyObserver& observer ){
-       observer( m_empty );
-       m_observers.erase( observer );
-}
-const char* c_str() const {
-       if ( string_empty( m_string.c_str() ) ) {
-               return m_empty;
+       void instanceAttach( MapFile* map ){
+               m_undo.instanceAttach( map );
        }
-       return m_string.c_str();
-}
-void assign( const char* other ){
-       if ( !string_equal( m_string.c_str(), other ) ) {
-               m_undo.save();
-               m_string = other;
-               notify();
+       void instanceDetach( MapFile* map ){
+               m_undo.instanceDetach( map );
        }
-}
 
-void notify(){
-       m_entityKeyValueChanged();
-       KeyObservers::reverse_iterator i = m_observers.rbegin();
-       while ( i != m_observers.rend() )
-       {
-               ( *i++ )( c_str() );
+       void attach( const KeyObserver& observer ){
+               ( *m_observers.insert ( observer ) )( c_str() );
+       }
+       void detach( const KeyObserver& observer ){
+               observer( m_empty );
+               m_observers.erase( observer );
+       }
+       const char* c_str() const {
+               if ( string_empty( m_string.c_str() ) ) {
+                       return m_empty;
+               }
+               return m_string.c_str();
+       }
+       void assign( const char* other ){
+               if ( !string_equal( m_string.c_str(), other ) ) {
+                       m_undo.save();
+                       m_string = other;
+                       notify();
+               }
        }
-}
 
-void importState( const CopiedString& string ){
-       m_string = string;
+       void notify(){
+               m_entityKeyValueChanged();
+               KeyObservers::reverse_iterator i = m_observers.rbegin();
+               while ( i != m_observers.rend() )
+               {
+                       ( *i++ )( c_str() );
+               }
+       }
 
-       notify();
-}
-typedef MemberCaller1<KeyValue, const CopiedString&, &KeyValue::importState> UndoImportCaller;
+       void importState( const CopiedString& string ){
+               m_string = string;
+
+               notify();
+       }
+       typedef MemberCaller<KeyValue, void(const CopiedString&), &KeyValue::importState> UndoImportCaller;
 };
 
 /// \brief An unsorted list of key/value pairs.
@@ -419,18 +419,6 @@ private:
                }
                m_observerMutex = false;
        }
-       void forEachKeyValue_notifyInsert(){
-               for ( KeyValues::const_iterator i = m_keyValues.begin(); i != m_keyValues.end(); ++i )
-               {
-                       notifyInsert( ( *i ).first.c_str(), *( *i ).second );
-               }
-       }
-       void forEachKeyValue_notifyErase(){
-               for ( KeyValues::const_iterator i = m_keyValues.begin(); i != m_keyValues.end(); ++i )
-               {
-                       notifyErase( ( *i ).first.c_str(), *( *i ).second );
-               }
-       }
 
        void insert( const char* key, const KeyValuePtr& keyValue ){
                KeyValues::iterator i = m_keyValues.insert( KeyValues::value_type( key, keyValue ) );
@@ -524,7 +512,7 @@ public:
 
                m_entityKeyValueChanged();
        }
-       typedef MemberCaller1<EntityKeyValues, const KeyValues&, &EntityKeyValues::importState> UndoImportCaller;
+       typedef MemberCaller<EntityKeyValues, void(const KeyValues&), &EntityKeyValues::importState> UndoImportCaller;
 
        void attach( Observer& observer ){
                ASSERT_MESSAGE( !m_observerMutex, "observer cannot be attached during iteration" );