OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimNitfTagFactoryRegistry.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // LICENSE: See top level LICENSE.txt file.
4 //
5 // Author: Garrett Potts
6 //
7 // Description: Nitf support class
8 //
9 //********************************************************************
10 // $Id: ossimNitfTagFactoryRegistry.cpp 22875 2014-08-27 13:52:03Z dburken $
11 
16 
17 #include <algorithm> /* for std::find */
18 
20 {
22 }
23 
25 {
26 }
27 
29 {
30  if(aFactory&&!exists(aFactory))
31  {
32  theFactoryList.push_back(aFactory);
33  }
34 }
35 
38 {
39  std::vector<ossimNitfTagFactory*>::iterator iter =
40  std::find(theFactoryList.begin(),
41  theFactoryList.end(),
42  aFactory);
43  if(iter != theFactoryList.end())
44  {
45  theFactoryList.erase(iter);
46  }
47 }
48 
50 {
51  static ossimNitfTagFactoryRegistry inst;
52  return &inst;
53 }
54 
56 {
57  std::vector<ossimNitfTagFactory*>::const_iterator factory;
59 
60  factory = theFactoryList.begin();
61  while(factory != theFactoryList.end())
62  {
63  result = (*factory)->create(tagName);
64 
65  if(result.valid())
66  {
67  return result;
68  }
69  ++factory;
70  }
71 
73  return tag;
74 }
75 
77 {
80 }
81 
83 {
84  std::vector<ossimNitfTagFactory*>::const_iterator iter = std::find(theFactoryList.begin(),
85  theFactoryList.end(),
86  factory);
87 
88  return (iter != theFactoryList.end());
89 
90 }
91 
94 {
95 }
96 
99 {
100  return *this;
101 }
bool exists(ossimNitfTagFactory *factory) const
bool valid() const
Definition: ossimRefPtr.h:75
void registerFactory(ossimNitfTagFactory *aFactory)
static ossimNitfRpfTagFactory * instance()
static ossimNitfTagFactoryRegistry * instance()
std::vector< ossimNitfTagFactory * > theFactoryList
const ossimNitfTagFactoryRegistry & operator=(const ossimNitfTagFactoryRegistry &factory)
hidden operator=
static ossimNitfRegisteredTagFactory * instance()
void unregisterFactory(ossimNitfTagFactory *aFactory)
ossimRefPtr< ossimNitfRegisteredTag > create(const ossimString &tagName) const