1 /*------------------------------------------------------------------------------
 2 Name:      EraseQueueEntry.h
 3 Project:   xmlBlaster.org
 4 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
 5 ------------------------------------------------------------------------------*/
 6 
 7 #ifndef _UTIL_QUEUE_ERASEQUEUEENRY_H
 8 #define _UTIL_QUEUE_ERASEQUEUEENRY_H
 9 
10 #include <util/MethodName.h>
11 #include <util/queue/MsgQueueEntry.h>
12 #include <client/qos/EraseQos.h>
13 #include <client/qos/EraseReturnQos.h>
14 #include <client/key/EraseKey.h>
15 
16 
17 /**
18  * Class embedding messages or information to be stored on the client queues
19  * Note that all content is copied when passed to the constructors.
20  * This way this queue entry is the owner of the content (and therefore will
21  * delete it when its destructor is called).
22  *
23  * @author <a href='mailto:laghi@swissinfo.org'>Michele Laghi</a>
24  */
25 namespace org { namespace xmlBlaster { namespace util { namespace queue {
26 
27 class Dll_Export EraseQueueEntry : public org::xmlBlaster::util::queue::MsgQueueEntry
28 {
29 public:
30 
31    /**
32     * Constructor for erase operations. 
33     */
34    EraseQueueEntry(org::xmlBlaster::util::Global& global,
35                        const org::xmlBlaster::client::key::EraseKey& eraseKey,
36                        const org::xmlBlaster::client::qos::EraseQos& eraseQos,
37                        int priority=NORM_PRIORITY,
38                        org::xmlBlaster::util::Timestamp uniqueId = TimestampFactory::getInstance().getTimestamp());
39 
40    ~EraseQueueEntry();
41 
42    /**
43     * copy constructor
44     */
45    EraseQueueEntry(const EraseQueueEntry& entry);
46 
47    /**
48     * assignment constructor
49     */
50    EraseQueueEntry& operator =(const EraseQueueEntry& entry);
51 
52    MsgQueueEntry *getClone() const;
53 
54    virtual bool isErase() const;
55 
56    // this should actually be in another interface but since it is an only method we put it here.
57    const org::xmlBlaster::util::queue::MsgQueueEntry& send(org::xmlBlaster::util::dispatch::I_ConnectionsHandler& connectionsHandler) const;
58 
59    /**
60     * @return A copy of the erase QoS
61     */
62    org::xmlBlaster::client::qos::EraseQos getEraseQos() const;
63 
64    /**
65     * @return A copy of the erase Key
66     */
67    org::xmlBlaster::client::key::EraseKey getEraseKey() const;
68  
69    org::xmlBlaster::client::qos::EraseReturnQos getEraseReturnQos() const;
70 
71    std::string toXml(const std::string& indent="") const;
72 
73 };
74 
75 }}}} // namespace
76 
77 #endif


syntax highlighted by Code2HTML, v. 0.9.1