OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Attributes | List of all members
ossimWebRequestFactoryRegistry Class Reference

This will later be changed fro ossimHttpRequest to ossimWebRequest so we have a base class for general schema access such as ftp, sftp,smtp, ... More...

#include <ossimWebRequestFactoryRegistry.h>

Inheritance diagram for ossimWebRequestFactoryRegistry:
ossimWebRequestFactoryBase ossimFactoryListInterface< ossimWebRequestFactoryBase, ossimWebRequest > ossimBaseObjectFactory ossimObjectFactory ossimObject ossimReferenced

Public Member Functions

virtual ossimWebRequestcreate (const ossimUrl &url)
 
virtual ossimHttpRequestcreateHttp (const ossimUrl &url)
 
virtual ossimObjectcreateObject (const ossimString &typeName) const
 
virtual ossimObjectcreateObject (const ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual void getTypeNameList (std::vector< ossimString > &typeList) const
 
- Public Member Functions inherited from ossimBaseObjectFactory
 ossimBaseObjectFactory ()
 
virtual ~ossimBaseObjectFactory ()
 
- Public Member Functions inherited from ossimObjectFactory
virtual ~ossimObjectFactory ()
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimObjectdup () const
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getDescription () const
 
virtual ossimString getClassName () const
 
virtual RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
virtual std::ostream & print (std::ostream &out) const
 Generic print method. More...
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
virtual void accept (ossimVisitor &visitor)
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 
- Public Member Functions inherited from ossimFactoryListInterface< ossimWebRequestFactoryBase, ossimWebRequest >
 ossimFactoryListInterface ()
 
void addFactory (ossimWebRequestFactoryBase *factory)
 This is for backward compatability and calls registerFactory for simple adds. More...
 
bool isFactoryRegistered (ossimWebRequestFactoryBase *factory) const
 Public access method to determine if a factory is already registered to this list. More...
 
void registerFactory (ossimWebRequestFactoryBase *factory, bool pushToFrontFlag=false)
 Will register a factory to the factory list. More...
 
void unregisterFactory (ossimWebRequestFactoryBase *factory)
 Will remove the factory from the registry. More...
 
void unregisterFactory (const ossimString &factoryTypeName)
 Will remove the factory from the registry by name. More...
 
void unregisterAllFactories ()
 Will remove all factories from the registry. More...
 
void registerFactoryToFront (ossimWebRequestFactoryBase *factory)
 Inserts the factory to the front of the list. More...
 
void registerFactoryBefore (ossimWebRequestFactoryBase *factory, ossimWebRequestFactoryBase *beforeThisFactory)
 Will insert the factory before the beforeThisFactory. More...
 
void getAllTypeNamesFromRegistry (std::vector< ossimString > &typeList) const
 Will add all object types the factories can allocate. More...
 
ossimObjectcreateObjectFromRegistry (const ossimString &typeName) const
 This is the base object return for all objects in the system. More...
 
ossimObjectcreateObjectFromRegistry (const ossimKeywordlist &kwl, const char *prefix=0) const
 This is the base object return for all objects in the system. More...
 
ossimWebRequestcreateNativeObjectFromRegistry (const ossimString &typeName) const
 This is a helper method that calls the createObject and makes sure that the returned object is of the NativeType base type this registry supports. More...
 
ossimWebRequestcreateNativeObjectFromRegistry (const ossimKeywordlist &kwl, const char *prefix=0) const
 This is a helper method that calls the createObject and makes sure that the returned object is of the NativeType base type this registry supports. More...
 

Static Public Member Functions

static ossimWebRequestFactoryRegistryinstance ()
 
- Static Public Member Functions inherited from ossimBaseObjectFactory
static ossimBaseObjectFactoryinstance ()
 

Protected Member Functions

 ossimWebRequestFactoryRegistry ()
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 
- Protected Member Functions inherited from ossimFactoryListInterface< ossimWebRequestFactoryBase, ossimWebRequest >
bool findFactory (ossimWebRequestFactoryBase *factory) const
 Utility to find a factory in the list. More...
 

Static Protected Attributes

static ossimWebRequestFactoryRegistrym_instance = 0
 

Additional Inherited Members

- Public Types inherited from ossimFactoryListInterface< ossimWebRequestFactoryBase, ossimWebRequest >
typedef std::vector< ossimWebRequestFactoryBase *> FactoryListType
 
typedef ossimWebRequestFactoryBase FactoryType
 
typedef ossimWebRequest NativeReturnType
 
- Protected Attributes inherited from ossimFactoryListInterface< ossimWebRequestFactoryBase, ossimWebRequest >
std::mutex m_factoryListMutex
 
FactoryListType m_factoryList
 

Detailed Description

This will later be changed fro ossimHttpRequest to ossimWebRequest so we have a base class for general schema access such as ftp, sftp,smtp, ...

etc and not just restricted to http and https schema definitions.

Definition at line 13 of file ossimWebRequestFactoryRegistry.h.

Constructor & Destructor Documentation

◆ ossimWebRequestFactoryRegistry()

ossimWebRequestFactoryRegistry::ossimWebRequestFactoryRegistry ( )
protected

Definition at line 6 of file ossimWebRequestFactoryRegistry.cpp.

References m_instance.

Referenced by instance().

7 {
8  m_instance = this;
9 }
static ossimWebRequestFactoryRegistry * m_instance

Member Function Documentation

◆ create()

ossimWebRequest * ossimWebRequestFactoryRegistry::create ( const ossimUrl url)
virtual

Reimplemented from ossimWebRequestFactoryBase.

Definition at line 28 of file ossimWebRequestFactoryRegistry.cpp.

References ossimFactoryListInterface< ossimWebRequestFactoryBase, ossimWebRequest >::m_factoryList.

Referenced by createHttp().

29 {
30  ossim_uint32 idx = 0;
31  ossimWebRequest* result = 0;
32  for(idx = 0; ((idx < m_factoryList.size())&&!result); ++idx)
33  {
34  result = m_factoryList[idx]->create(url);
35  }
36 
37  return result;
38 }
unsigned int ossim_uint32

◆ createHttp()

ossimHttpRequest * ossimWebRequestFactoryRegistry::createHttp ( const ossimUrl url)
virtual

Definition at line 40 of file ossimWebRequestFactoryRegistry.cpp.

References create(), ossimRefPtr< T >::get(), ossimRefPtr< T >::release(), and ossimRefPtr< T >::valid().

Referenced by ossimKakaduJpipHandler::allocateSession(), and ossimKakaduJpipHandler::loadClient().

41 {
42  ossimRefPtr<ossimWebRequest> request = create(url);
44  if(request.valid())
45  {
46  result = dynamic_cast<ossimHttpRequest*>(request.get());
47  request = 0;
48  }
49 
50  return result.release();
51 }
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossimWebRequest * create(const ossimUrl &url)
T * release()
Definition: ossimRefPtr.h:93

◆ createObject() [1/2]

virtual ossimObject* ossimWebRequestFactoryRegistry::createObject ( const ossimString typeName) const
inlinevirtual

Creates an object given a type name.

Reimplemented from ossimBaseObjectFactory.

Definition at line 26 of file ossimWebRequestFactoryRegistry.h.

References ossimFactoryListInterface< T, NativeType >::createObjectFromRegistry().

27  {
28  return createObjectFromRegistry(typeName);
29  }
ossimObject * createObjectFromRegistry(const ossimString &typeName) const
This is the base object return for all objects in the system.

◆ createObject() [2/2]

ossimObject * ossimWebRequestFactoryRegistry::createObject ( const ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual

Creates and object given a keyword list.

Reimplemented from ossimBaseObjectFactory.

Definition at line 22 of file ossimWebRequestFactoryRegistry.cpp.

References ossimFactoryListInterface< ossimWebRequestFactoryBase, ossimWebRequest >::createObjectFromRegistry().

24 {
25  return createObjectFromRegistry(kwl, prefix);
26 }
ossimObject * createObjectFromRegistry(const ossimString &typeName) const
This is the base object return for all objects in the system.

◆ getTypeNameList()

virtual void ossimWebRequestFactoryRegistry::getTypeNameList ( std::vector< ossimString > &  typeList) const
inlinevirtual

This should return the type name of all objects in all factories. This is the name used to construct the objects dynamially and this name must be unique.

Reimplemented from ossimBaseObjectFactory.

Definition at line 41 of file ossimWebRequestFactoryRegistry.h.

References ossimFactoryListInterface< T, NativeType >::getAllTypeNamesFromRegistry().

42  {
44  }
void getAllTypeNamesFromRegistry(std::vector< ossimString > &typeList) const
Will add all object types the factories can allocate.

◆ instance()

ossimWebRequestFactoryRegistry * ossimWebRequestFactoryRegistry::instance ( )
static

Member Data Documentation

◆ m_instance

ossimWebRequestFactoryRegistry * ossimWebRequestFactoryRegistry::m_instance = 0
staticprotected

Definition at line 47 of file ossimWebRequestFactoryRegistry.h.

Referenced by instance(), and ossimWebRequestFactoryRegistry().


The documentation for this class was generated from the following files: