OpenMAMA
Wombat::MamdaNewsStory Class Reference

MamdaNewsStory represents a complete text of a news story. More...

#include <MamdaNewsStory.h>

Public Types

enum  Status {
  NO_STORY = 0, FULL_STORY = 1, FETCHING_STORY = 2, DELAYED_STORY = 3,
  NOT_FOUND = 4, DELETED = 5, EXPIRED = 6, UNKNOWN = 99
}
 The Status enumeration provides information about the status of the news story and is provided in responses to news story requests. More...
 

Public Member Functions

 MamdaNewsStory ()
 Default constructor. More...
 
 MamdaNewsStory (const MamdaNewsStory &copy)
 Copy constructor. More...
 
virtual ~MamdaNewsStory ()
 Destructor. More...
 
virtual MamdaNewsStoryoperator= (const MamdaNewsStory &rhs)
 Assignment operator. More...
 
virtual void setStory (const char *storyText, const char *storyId, uint16_t storyRevNum, Status storyStatus, const MamaDateTime &storyTime, const MamaDateTime &storyOrigTime, const MamdaNewsHeadlineId *headlines, mama_size_t numHeadlines)
 Set all of the news story attributes. More...
 
virtual void setNewsStoryText (const char *storyText)
 Set the news story text. More...
 
virtual const char * getNewsStoryText () const
 
virtual void setNewsStoryId (MamdaNewsStoryId storyId)
 Set the news story id. More...
 
virtual MamdaNewsStoryId getNewsStoryId () const
 
virtual void setNewsStoryRevNumber (uint16_t storyRevNum)
 Set the story revision number. More...
 
virtual uint16_t getNewsStoryRevNumber () const
 
virtual void setStatus (Status status)
 Set the story status. More...
 
virtual Status getStatus () const
 
virtual const MamaDateTime & getStoryTime () const
 
virtual const MamaDateTime & getOrigStoryTime () const
 
virtual void getHeadlines (const MamdaNewsHeadlineId *&headlines, mama_size_t &numHeadlines) const
 
void setSubscInfo (MamaQueue *queue, MamaSource *source)
 
MamaQueue * getQueue () const
 
MamaSource * getSource () const
 

Static Public Member Functions

static Status toStatus (const char *strVal)
 Convert a string representation of a Status to the enumerated representation. More...
 
static const char * toString (Status status)
 Convert an enumerated representation of a Status to a string representation. More...
 

Detailed Description

MamdaNewsStory represents a complete text of a news story.

Member Enumeration Documentation

The Status enumeration provides information about the status of the news story and is provided in responses to news story requests.

NO_STORY indicates that there is currently no story for the headline. This may occur for feeds that provide "alert" headlines, either as the only headline or as a precursor to a full story.

FULL_STORY indicates that the complete story text is being provided in the current callback.

FETCHING_STORY indicates that the story is currently being fetched by the publisher. This is a temporary status. An additional callback will automatically be invoked when the full story is available.

DELAYED_STORY indicates that the story is not currently available but is expected at some time in the future. No additional callback will be automatically invoked.

NOT_FOUND indicates that the publisher does not currently have a story for this headline and cannot determine whether a story will arrive for the headline. No additional callback will be automatically invoked.

UNKNOWN indicates an unknown condition (should not happen).

Enumerator
NO_STORY 
FULL_STORY 
FETCHING_STORY 
DELAYED_STORY 
NOT_FOUND 
DELETED 
EXPIRED 
UNKNOWN 
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  };
Definition: MamdaNewsStory.h:70
Definition: MamdaNewsStory.h:73
Definition: MamdaNewsStory.h:76
Definition: MamdaNewsStory.h:71
Definition: MamdaNewsStory.h:74
Definition: MamdaNewsStory.h:77
Definition: MamdaNewsStory.h:72
Definition: MamdaNewsStory.h:75

Constructor & Destructor Documentation

Wombat::MamdaNewsStory::MamdaNewsStory ( )

Default constructor.

Wombat::MamdaNewsStory::MamdaNewsStory ( const MamdaNewsStory copy)

Copy constructor.

virtual Wombat::MamdaNewsStory::~MamdaNewsStory ( )
virtual

Destructor.

Member Function Documentation

virtual MamdaNewsStory& Wombat::MamdaNewsStory::operator= ( const MamdaNewsStory rhs)
virtual

Assignment operator.

virtual void Wombat::MamdaNewsStory::setStory ( const char *  storyText,
const char *  storyId,
uint16_t  storyRevNum,
Status  storyStatus,
const MamaDateTime &  storyTime,
const MamaDateTime &  storyOrigTime,
const MamdaNewsHeadlineId headlines,
mama_size_t  numHeadlines 
)
virtual

Set all of the news story attributes.

virtual void Wombat::MamdaNewsStory::setNewsStoryText ( const char *  storyText)
virtual

Set the news story text.

virtual const char* Wombat::MamdaNewsStory::getNewsStoryText ( ) const
virtual
Returns
The text of the story.
virtual void Wombat::MamdaNewsStory::setNewsStoryId ( MamdaNewsStoryId  storyId)
virtual

Set the news story id.

virtual MamdaNewsStoryId Wombat::MamdaNewsStory::getNewsStoryId ( ) const
virtual
Returns
The unique (for the data source) story ID for this news story.
virtual void Wombat::MamdaNewsStory::setNewsStoryRevNumber ( uint16_t  storyRevNum)
virtual

Set the story revision number.

virtual uint16_t Wombat::MamdaNewsStory::getNewsStoryRevNumber ( ) const
virtual
Returns
The revision number. Note: the value returned is zero if the data source does not provide revision numbers.
virtual void Wombat::MamdaNewsStory::setStatus ( Status  status)
virtual

Set the story status.

virtual Status Wombat::MamdaNewsStory::getStatus ( ) const
virtual
Returns
The story status.
virtual const MamaDateTime& Wombat::MamdaNewsStory::getStoryTime ( ) const
virtual
Returns
The latest story update time (e.g. time of correction).
virtual const MamaDateTime& Wombat::MamdaNewsStory::getOrigStoryTime ( ) const
virtual
Returns
The original story publish time.
virtual void Wombat::MamdaNewsStory::getHeadlines ( const MamdaNewsHeadlineId *&  headlines,
mama_size_t &  numHeadlines 
) const
virtual
Returns
All of the headline IDs associated with this news story.
static Status Wombat::MamdaNewsStory::toStatus ( const char *  strVal)
static

Convert a string representation of a Status to the enumerated representation.

static const char* Wombat::MamdaNewsStory::toString ( Status  status)
static

Convert an enumerated representation of a Status to a string representation.

void Wombat::MamdaNewsStory::setSubscInfo ( MamaQueue *  queue,
MamaSource *  source 
)
MamaQueue* Wombat::MamdaNewsStory::getQueue ( ) const
MamaSource* Wombat::MamdaNewsStory::getSource ( ) const

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


© 2012 Linux Foundation