OpenMAMA
MamdaNewsStory.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 MamdaNewsStoryH
23 #define MamdaNewsStoryH
24 
27 #include <mama/mamacpp.h>
28 
29 namespace Wombat
30 {
31 
36  class MAMDAOPTExpDLL MamdaNewsStory
37  {
38  public:
68  enum Status
69  {
70  NO_STORY = 0,
71  FULL_STORY = 1,
72  FETCHING_STORY = 2,
73  DELAYED_STORY = 3,
74  NOT_FOUND = 4,
75  DELETED = 5,
76  EXPIRED = 6,
77  UNKNOWN = 99
78  };
79 
83  MamdaNewsStory ();
84 
88  MamdaNewsStory (const MamdaNewsStory& copy);
89 
93  virtual ~MamdaNewsStory ();
94 
98  virtual MamdaNewsStory& operator= (const MamdaNewsStory& rhs);
99 
103  virtual void setStory (
104  const char* storyText,
105  const char* storyId,
106  uint16_t storyRevNum,
107  Status storyStatus,
108  const MamaDateTime& storyTime,
109  const MamaDateTime& storyOrigTime,
110  const MamdaNewsHeadlineId* headlines,
111  mama_size_t numHeadlines);
112 
116  virtual void setNewsStoryText (const char* storyText);
117 
121  virtual const char* getNewsStoryText() const;
122 
126  virtual void setNewsStoryId (MamdaNewsStoryId storyId);
127 
132  virtual MamdaNewsStoryId getNewsStoryId() const;
133 
137  virtual void setNewsStoryRevNumber (uint16_t storyRevNum);
138 
143  virtual uint16_t getNewsStoryRevNumber() const;
144 
148  virtual void setStatus (Status status);
149 
153  virtual Status getStatus () const;
154 
158  virtual const MamaDateTime& getStoryTime () const;
159 
163  virtual const MamaDateTime& getOrigStoryTime () const;
164 
168  virtual void getHeadlines (const MamdaNewsHeadlineId*& headlines,
169  mama_size_t& numHeadlines) const;
170 
175  static Status toStatus (const char* strVal);
176 
181  static const char* toString (Status status);
182 
183  public:
184  // Implementation subscription information:
185  void setSubscInfo (MamaQueue* queue,
186  MamaSource* source);
187 
188  MamaQueue* getQueue () const;
189  MamaSource* getSource () const;
190 
191  private:
192  struct MamdaNewsStoryImpl;
193  MamdaNewsStoryImpl& mImpl;
194  };
195 
196 } // namespace
197 
198 #endif // MamdaNewsStoryH


© 2012 Linux Foundation