24 static const char* NUM_THREADS_KW =
"ossimImageChainMtAdaptor.num_threads";
25 static const char* ORIGINAL_SOURCE_ID_KW =
"ossimImageChainMtAdaptor.original_source_id";
32 d_useSharedHandlers(false),
33 d_debugEnabled(false),
34 d_cacheTileSize(1024),
50 d_useSharedHandlers(false),
51 d_debugEnabled(false),
52 d_cacheTileSize(1024),
104 if ( !value.
empty() )
133 if (original == NULL)
137 if (first_source == NULL)
234 std::vector< ossimRefPtr<ossimImageSource> >::iterator first_copy =
m_clones.begin();
255 kwl.
write(
"ossimImageChainMtAdaptor.kwl");
281 value = kwl.
find(prefix, ORIGINAL_SOURCE_ID_KW);
303 if (original_source == NULL)
305 m_clones.push_back(original_source);
363 for (
size_t i=0; i<
m_clones.size(); ++i)
375 "Should never be called directly. The tile request must go to the specific chain clone. " 376 "Returning a tile using the original chain's getTile (not threaded)..."<<endl;
402 ConnectableObjectList::iterator output_connection = handler_connections.begin();
413 if (output_obj == NULL)
457 "NOT YET IMPLEMENTED"<<endl;
474 bool makeInputConnection,
475 bool createEventFlag)
478 std::vector< ossimRefPtr<ossimImageSource> >::iterator clone_source =
m_clones.begin();
479 while (clone_source !=
m_clones.end())
481 (*clone_source)->connectMyOutputTo(outputObject,
false,
false);
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=NULL) const
Adapts call to original chain so that adapter-specific keywords can be added to KWL.
ossimRefPtr< ossimImageChain > m_adaptedChain
This is the adaptee image chain.
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &tileRect, ossim_uint32 resLevel=0)
Within the image chain will pass the head of the list.
Intended mainly to provide a mechanism for mutex-locking access to a shared resource during a getTile...
virtual ossimImageSource * getFirstSource()
Return the first source which is the one that first receives the getTile request. ...
SharedHandlerList m_sharedHandlers
Represents serializable keyword/value map.
std::vector< ossimRefPtr< ossimImageSource > > m_clones
List of replicated child chains' first source (the one receiving the getTile call).
const char * find(const char *key) const
static const ossim_int64 INVALID_ID
ossim_uint32 d_cacheTileSize
ossim_uint32 toUInt32() const
void setOriginalChain(ossimImageChain *original)
Alternate way of specifying the original chain being adapted for multi-threading. ...
void setNumberOfThreads(ossim_uint32 num_threads)
Alternate way of specifying number of threads to support.
ossim_int64 getId() const
virtual bool write(const char *file, const char *comment=0) const
Methods to dump the ossimKeywordlist to a file on disk.
bool replicate()
Creates clones of original and pushes them onto the clone list. Returns TRUE if successful.
virtual ossim_int32 connectMyOutputTo(ossimConnectableObject *outputObject, bool makeInputConnection=true, bool createEventFlag=true)
Overrides base class implementation in order to make the connection to each clone.
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
std::vector< ossimRefPtr< ossimConnectableObject > > ConnectableObjectList
ossim_uint32 m_numThreads
virtual void changeOwner(ossimObject *owner)
Permits changing the object's owner.
const char * findPreference(const char *key) const
const ossimId & getId() const
Will allow us to get this object's id.
void setUseSharedHandlers(bool use_shared_handlers)
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These overriding access methods greatly facilitate the implementation of an image chain adapter class...
unsigned int ossim_uint32
virtual void processEvent(ossimEvent &event)
Adapts the image chain event handler.
virtual bool add(ossimConnectableObject *source)
Will return true or false if an image source was added to the chain.
virtual ossim_int32 connectMyInputTo(ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
Will try to connect this objects input to the passed in object.
void deleteReplicas()
Deletes instances of all replicas from the clone list and leaves only the original.
ossimConnectableObject * getObject()
static ossimPreferences * instance()
void setUseCache(bool use_cache)
For debugging purposes. To be removed with final release:
virtual void initialize()
Adapts call to original chain so that all clones are initialized.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=NULL)
Adapts call to original chain so that clones are replicated after original's loadState.
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &tileRect, ossim_uint32 resLevel=0)
Intercepts the getTile because it should never be called directly.
virtual ossim_int32 connectMyOutputTo(ossimConnectableObject *outputObject, bool makeInputConnection=true, bool createEventFlag=true)
Will try to connect this objects output to the passed in object.
void setId(ossim_int64 id)
T * getObjectAs(ossim_uint32 idx=0)
This class defines an abstract Handler which all image handlers(loaders) should derive from...
bool connectSharedHandlers(ossim_uint32 index)
Manages reconnecting shared image handlers to a cloned image chain (identified by index) after its cr...
ossimConnectableObject::ConnectableObjectList theImageChainList
This will hold a sequence of image sources.
ossim_int64 toInt64() const
ossimImageSource * getClone(ossim_uint32 index)
Returns pointer to a specific clone image chain, or NULL if index exceeds the max available...
virtual bool fillContainer(ossimConnectableContainer &container)
Inserts this object and all of its children and inputs into the container provided.
void setCacheTileSize(ossim_uint32 cache_tile_size)
ossimImageChainMtAdaptor()
static ossimMtDebug * instance()
std::vector< ossimRefPtr< ossimConnectableContainer > > m_chainContainers
The container objects must be kept alive in this vector while their child chains in m_clones are used...
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
~ossimImageChainMtAdaptor()
virtual bool removeListener(ossimListener *listener)