osgEarth 2.1.1
Public Member Functions | Public Attributes

AsyncUpdateAccessTimePool Struct Reference

Inheritance diagram for AsyncUpdateAccessTimePool:
Collaboration diagram for AsyncUpdateAccessTimePool:

List of all members.

Public Member Functions

 AsyncUpdateAccessTimePool (const std::string &cacheId, Sqlite3Cache *cache)
void addEntry (const TileKey &key, int timeStamp)
void addEntryInternal (const TileKey &key)
void operator() (ProgressCallback *progress)
const std::string & getCacheId ()
int getNbEntry () const

Public Attributes

std::map< std::string, int > _keys
std::string _cacheId
std::string _keyStr
int _timeStamp
osg::observer_ptr< Sqlite3Cache_cache

Detailed Description

Definition at line 983 of file Sqlite3Cache.cpp.


Constructor & Destructor Documentation

AsyncUpdateAccessTimePool::AsyncUpdateAccessTimePool ( const std::string &  cacheId,
Sqlite3Cache cache 
)

Definition at line 1694 of file Sqlite3Cache.cpp.

                                                                                                  :
_cacheId(cacheId), _cache(cache)
{
    //nop
}

Member Function Documentation

void AsyncUpdateAccessTimePool::addEntry ( const TileKey key,
int  timeStamp 
)

Definition at line 1700 of file Sqlite3Cache.cpp.

{
    unsigned int lod = key.getLevelOfDetail();
    addEntryInternal(key);
    if (lod > 0) {
        TileKey previous = key;
        for (int i = (int)lod-1; i >= 0; --i) {
            TileKey ancestor = previous.createAncestorKey(i);
            if (ancestor.valid())
                addEntryInternal(ancestor);
            previous = ancestor;
        }
    }
    _timeStamp = timeStamp;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void AsyncUpdateAccessTimePool::addEntryInternal ( const TileKey key)

Definition at line 1716 of file Sqlite3Cache.cpp.

{
    const std::string& keyStr = key.str();
    if (_keys.find(keyStr) == _keys.end()) {
        _keys[keyStr] = 1;
        if (_keyStr.empty())
            _keyStr = keyStr;
        else
            _keyStr += ", " + keyStr;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

const std::string& AsyncUpdateAccessTimePool::getCacheId ( ) [inline]

Definition at line 990 of file Sqlite3Cache.cpp.

{ return _cacheId; }
int AsyncUpdateAccessTimePool::getNbEntry ( ) const [inline]

Definition at line 991 of file Sqlite3Cache.cpp.

{ return _keys.size(); }
void AsyncUpdateAccessTimePool::operator() ( ProgressCallback progress) [virtual]

Implements osgEarth::TaskRequest.

Definition at line 1728 of file Sqlite3Cache.cpp.

{ 
    osg::ref_ptr<Sqlite3Cache> cache = _cache.get();
    if ( cache.valid() ) {
        //OE_INFO << "AsyncUpdateAccessTimePool will process " << _keys.size() << std::endl;
        cache->updateAccessTimeSyncPool( _cacheId, _keyStr , _timeStamp );
    }
}

Member Data Documentation

Definition at line 996 of file Sqlite3Cache.cpp.

Definition at line 993 of file Sqlite3Cache.cpp.

std::map<std::string, int> AsyncUpdateAccessTimePool::_keys

Definition at line 992 of file Sqlite3Cache.cpp.

Definition at line 994 of file Sqlite3Cache.cpp.

Definition at line 995 of file Sqlite3Cache.cpp.


The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines