OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimAnnotationObjectFactory.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 // Copyright (C) 2000 ImageLinks Inc.
3 //
4 // License: See LICENSE.txt file in the top level directory.
5 //
6 // Author: Garrett Potts
7 //
8 //*************************************************************************
9 // $Id: ossimAnnotationObjectFactory.cpp 9094 2006-06-13 19:12:40Z dburken $
11 
16 
18 
21 {
22 }
23 
25  const ossimString& spec) const
26 {
28  {
30  }
32  {
34  }
36  {
38  }
40  {
42  }
43 
44  return NULL;
45 }
46 
48  const ossimKeywordlist& kwl,
49  const char* prefix) const
50 {
51  ossimAnnotationObject* result = NULL;
52 
53  const char* type = kwl.find(prefix, "type");
54  if(type)
55  {
56  result = create(ossimString(type));
57  if(result)
58  {
59  result->loadState(kwl, prefix);
60  }
61  else
62  {
64  << "ossimAnnotationObjectFactory::create WARNING"
65  << "Unable to create object of type: "
66  << type << std::endl;
67  }
68  }
69 
70  return result;
71 }
72 
74 {
75  if(!theInstance)
76  {
78  }
79 
80  return theInstance;
81 }
82 
83 //*****************************************************************************
84 // METHOD: ossimProjectionFactory::getList()
85 //
86 //*****************************************************************************
87 list<ossimString> ossimAnnotationObjectFactory::getList() const
88 {
89  list<ossimString> rtn_list;
90  list<ossimString> sub_list;
91  list<ossimFactoryBase<ossimAnnotationObject>*>::const_iterator factory;
92 
93  factory = theRegistry.begin();
94  while(factory != theRegistry.end())
95  {
96  sub_list = (*factory)->getList();
97  rtn_list.merge(sub_list);
98  ++factory;
99  }
100 
101  return rtn_list;
102 }
Represents serializable keyword/value map.
const char * find(const char *key) const
static ossimAnnotationObjectFactory * instance()
virtual list< ossimString > getList() const
#define STATIC_TYPE_NAME(T)
Definition: ossimRtti.h:325
std::list< ossimFactoryBase< ossimAnnotationObject > *> theRegistry
virtual ossimAnnotationObject * create(const ossimString &spec) const
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
static ossimAnnotationObjectFactory * theInstance
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)