OpenMAMA C++ API
MamaSourceManager.h
Go to the documentation of this file.
1 /* $Id$
2  *
3  * OpenMAMA: The open middleware agnostic messaging API
4  * Copyright (C) 2011 NYSE Technologies, Inc.
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301 USA
20  */
21 
22 #ifndef MamaSourceManager_CPP_H__
23 #define MamaSourceManager_CPP_H__
24 
25 #include <mama/sourceman.h>
26 #include <mama/types.h>
27 
28 namespace Wombat
29 {
30 
31  class MamaSource;
32 
38  class MAMACPPExpDLL MamaSourceManager
39  {
40  public:
42  virtual ~MamaSourceManager ();
43 
44  virtual MamaSource* create (const char* sourceName);
45  virtual MamaSource* findOrCreate (const char* sourceName);
46  virtual MamaSource* find (const char* sourceName);
47  virtual const MamaSource* find (const char* sourceName) const;
48  virtual void add (MamaSource* source);
49  virtual void add (const char* sourceName,
50  MamaSource* source);
51  mama_size_t size () const;
52 
53 
54  class MAMACPPExpDLL iterator
55  {
56  private:
57  friend class MamaSourceManager;
58  struct iteratorImpl;
59  iteratorImpl& mImpl;
60  iterator (const iteratorImpl& copy);
61  public:
62  iterator ();
63  iterator (const iterator& copy);
64  ~iterator ();
65 
66  iterator& operator= (const iterator& rhs);
67  const iterator& operator= (const iterator& rhs) const;
68  iterator& operator++ ();
69  const iterator& operator++ () const;
70  bool operator== (const iterator& rhs) const;
71  bool operator!= (const iterator& rhs) const;
72  MamaSource* operator* ();
73  const MamaSource* operator* () const;
74  };
75 
76  typedef const iterator const_iterator;
77 
78  iterator begin ();
79  const_iterator begin () const;
80  iterator end ();
81  const_iterator end () const;
82 
83  mamaSourceManager getCValue ()
84  {
85  return myManager;
86  }
87 
88  const mamaSourceManager getCValue () const
89  {
90  return myManager;
91  }
92 
93  private:
94  struct MamaSourceManagerImpl;
95  MamaSourceManagerImpl& myImpl;
96  mamaSourceManager myManager;
97 
98  // No copy constructor nor assignment operator.
100  MamaSourceManager& operator= (const MamaSourceManager& rhs);
101  };
102 
103 } // namespace Wombat
104 
105 #endif // MamaSourceManager_CPP_H__
A MAMA source manager maintains information about a set of data sources, including the quality of the...
Definition: MamaSourceManager.h:38
A MAMA source maintains information about a data source, including the quality of the data coming fro...
Definition: MamaSource.h:55
Definition: MamaSourceManager.h:54
Definition: MamaConnection.h:29
mamaSourceManager getCValue()
Definition: MamaSourceManager.h:83
const mamaSourceManager getCValue() const
Definition: MamaSourceManager.h:88
const iterator const_iterator
Definition: MamaSourceManager.h:76