示例#1
0
        /** ****************************************************************************************
         * Clears all data stored, resets all values.
         ******************************************************************************************/
        void Clear()
        {
            ALIB_ASSERT( Value == 0 );
            ALIB_ASSERT( Path.IsEmpty() );

            for ( auto child : Childs )
                delete child;

            Childs.clear();
        }
int ScopeDump::writeStoreMap( ScopeStore<T>* store )
{
    int cnt= 0;
    bool firstEntry= true;
    if ( store->globalStore && store->globalStore->size() > 0)
    {
        cnt+= (int) store->globalStore->size();
        if( firstEntry ) firstEntry= false; else   target.NewLine();
        target._NC( "  Scope::Global:" ).NewLine();
        maxKeyLength= writeStoreMapHelper( *store->globalStore, "    " );
    }

    for ( auto& thread : store->threadOuterStore )
    {
        if ( thread.second.size() == 0 )
            continue;
        ALIB_ASSERT( thread.second.size() == 1 );
        if( firstEntry ) firstEntry= false; else   target.NewLine();
        target._NC("  Scope::ThreadOuter ");  storeThreadToScope( thread.first )._( ':' ).NewLine();
        cnt+= (int) thread.second[0]->size();
        maxKeyLength= writeStoreMapHelper( *thread.second[0], "    " );
    }


    for ( auto& map : *store->languageStore )
    {
        cnt+= (int) map.Value->size();
        if( firstEntry ) firstEntry= false; else   target.NewLine();
        target._NC( "  " );
        storeKeyToScope   ( map )   ._( ':' ).NewLine();
        maxKeyLength= writeStoreMapHelper( *map.Value, "    " );
    }

    for ( auto& thread : store->threadInnerStore )
    {
        if ( thread.second.size() == 0 )
            continue;
        ALIB_ASSERT( thread.second.size() == 1 );
        if( firstEntry ) firstEntry= false; else   target.NewLine();
        target._NC("  Scope::ThreadInner ");  storeThreadToScope( thread.first )._( ':' ).NewLine();
        cnt+= (int) thread.second[0]->size();
        maxKeyLength= writeStoreMapHelper( *thread.second[0], "    " );
    }
    return cnt;
}
 /** ****************************************************************************************
  * Stores a new value for the given scope.
  * @param value      The value to set.
  * @return Returns the previous value stored.
  ******************************************************************************************/
 StoreT Store    ( StoreT value )
 {
     ALIB_ASSERT( value != ScopeStoreType<StoreT>::NullValue() );
     return access( 0, value );
 }