qpid/framing/DeliveryProperties.h Source File

Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET | Apache Qpid Documentation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

qpid/framing/DeliveryProperties.h
Go to the documentation of this file.

    00001 #ifndef QPID_FRAMING_DELIVERYPROPERTIES_H
    00002 #define QPID_FRAMING_DELIVERYPROPERTIES_H
    00003 /*
    00004  *
    00005  * Licensed to the Apache Software Foundation (ASF) under one
    00006  * or more contributor license agreements.  See the NOTICE file
    00007  * distributed with this work for additional information
    00008  * regarding copyright ownership.  The ASF licenses this file
    00009  * to you under the Apache License, Version 2.0 (the
    00010  * "License"); you may not use this file except in compliance
    00011  * with the License.  You may obtain a copy of the License at
    00012  *
    00013  *   http://www.apache.org/licenses/LICENSE-2.0
    00014  *
    00015  * Unless required by applicable law or agreed to in writing,
    00016  * software distributed under the License is distributed on an
    00017  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    00018  * KIND, either express or implied.  See the License for the
    00019  * specific language governing permissions and limitations
    00020  * under the License.
    00021  *
    00022  */
    00023
    00028
    00029
    00030
    00031 #include <ostream>
    00032 #include "qpid/framing/amqp_types_full.h"
    00033 #include "qpid/CommonImportExport.h"
    00034
    00035 namespace qpid {
    00036 namespace framing {
    00037
    00038 class QPID_COMMON_CLASS_EXTERN DeliveryProperties  {
    00039     uint8_t priority;
    00040     uint8_t deliveryMode;
    00041     uint64_t ttl;
    00042     uint64_t timestamp;
    00043     uint64_t expiration;
    00044     std::string exchange;
    00045     std::string routingKey;
    00046     std::string resumeId;
    00047     uint64_t resumeTtl;
    00048     uint16_t flags;
    00049 public:
    00050     static const uint16_t TYPE = 1025;
    00051     DeliveryProperties(
    00052         bool _discardUnroutable,
    00053         bool _immediate,
    00054         bool _redelivered,
    00055         uint8_t _priority,
    00056         uint8_t _deliveryMode,
    00057         uint64_t _ttl,
    00058         uint64_t _timestamp,
    00059         uint64_t _expiration,
    00060         const std::string& _exchange,
    00061         const std::string& _routingKey,
    00062         const std::string& _resumeId,
    00063         uint64_t _resumeTtl) :
    00064         priority(_priority),
    00065         deliveryMode(_deliveryMode),
    00066         ttl(_ttl),
    00067         timestamp(_timestamp),
    00068         expiration(_expiration),
    00069         exchange(_exchange),
    00070         routingKey(_routingKey),
    00071         resumeId(_resumeId),
    00072         resumeTtl(_resumeTtl),
    00073         flags(0){
    00074         setDiscardUnroutable(_discardUnroutable);
    00075         setImmediate(_immediate);
    00076         setRedelivered(_redelivered);
    00077         flags |= (1 << 11);
    00078         flags |= (1 << 12);
    00079         flags |= (1 << 13);
    00080         flags |= (1 << 14);
    00081         flags |= (1 << 15);
    00082         flags |= (1 << 0);
    00083         flags |= (1 << 1);
    00084         flags |= (1 << 2);
    00085         flags |= (1 << 3);
    00086     }
    00087     DeliveryProperties()  : priority(0), deliveryMode(0), ttl(0), timestamp(0), expiration(0), resumeTtl(0), flags(0) {}
    00088
    00089     QPID_COMMON_EXTERN void setDiscardUnroutable(bool _discardUnroutable);
    00090     QPID_COMMON_EXTERN bool getDiscardUnroutable() const;
    00091     QPID_COMMON_EXTERN void setImmediate(bool _immediate);
    00092     QPID_COMMON_EXTERN bool getImmediate() const;
    00093     QPID_COMMON_EXTERN void setRedelivered(bool _redelivered);
    00094     QPID_COMMON_EXTERN bool getRedelivered() const;
    00095     QPID_COMMON_EXTERN void setPriority(uint8_t _priority);
    00096     QPID_COMMON_EXTERN uint8_t getPriority() const;
    00097     QPID_COMMON_EXTERN bool hasPriority() const;
    00098     QPID_COMMON_EXTERN void clearPriorityFlag();
    00099     QPID_COMMON_EXTERN void setDeliveryMode(uint8_t _deliveryMode);
    00100     QPID_COMMON_EXTERN uint8_t getDeliveryMode() const;
    00101     QPID_COMMON_EXTERN bool hasDeliveryMode() const;
    00102     QPID_COMMON_EXTERN void clearDeliveryModeFlag();
    00103     QPID_COMMON_EXTERN void setTtl(uint64_t _ttl);
    00104     QPID_COMMON_EXTERN uint64_t getTtl() const;
    00105     QPID_COMMON_EXTERN bool hasTtl() const;
    00106     QPID_COMMON_EXTERN void clearTtlFlag();
    00107     QPID_COMMON_EXTERN void setTimestamp(uint64_t _timestamp);
    00108     QPID_COMMON_EXTERN uint64_t getTimestamp() const;
    00109     QPID_COMMON_EXTERN bool hasTimestamp() const;
    00110     QPID_COMMON_EXTERN void clearTimestampFlag();
    00111     QPID_COMMON_EXTERN void setExpiration(uint64_t _expiration);
    00112     QPID_COMMON_EXTERN uint64_t getExpiration() const;
    00113     QPID_COMMON_EXTERN bool hasExpiration() const;
    00114     QPID_COMMON_EXTERN void clearExpirationFlag();
    00115     QPID_COMMON_EXTERN void setExchange(const std::string& _exchange);
    00116     QPID_COMMON_EXTERN const std::string& getExchange() const;
    00117     QPID_COMMON_EXTERN bool hasExchange() const;
    00118     QPID_COMMON_EXTERN void clearExchangeFlag();
    00119     QPID_COMMON_EXTERN void setRoutingKey(const std::string& _routingKey);
    00120     QPID_COMMON_EXTERN const std::string& getRoutingKey() const;
    00121     QPID_COMMON_EXTERN bool hasRoutingKey() const;
    00122     QPID_COMMON_EXTERN void clearRoutingKeyFlag();
    00123     QPID_COMMON_EXTERN void setResumeId(const std::string& _resumeId);
    00124     QPID_COMMON_EXTERN const std::string& getResumeId() const;
    00125     QPID_COMMON_EXTERN bool hasResumeId() const;
    00126     QPID_COMMON_EXTERN void clearResumeIdFlag();
    00127     QPID_COMMON_EXTERN void setResumeTtl(uint64_t _resumeTtl);
    00128     QPID_COMMON_EXTERN uint64_t getResumeTtl() const;
    00129     QPID_COMMON_EXTERN bool hasResumeTtl() const;
    00130     QPID_COMMON_EXTERN void clearResumeTtlFlag();
    00131     QPID_COMMON_EXTERN friend std::ostream& operator<<(std::ostream&, const DeliveryProperties&);
    00132     QPID_COMMON_EXTERN void encode(Buffer&) const;
    00133     QPID_COMMON_EXTERN void decode(Buffer&, uint32_t=0);
    00134     QPID_COMMON_EXTERN void encodeStructBody(Buffer&) const;
    00135     QPID_COMMON_EXTERN void decodeStructBody(Buffer&, uint32_t=0);
    00136     QPID_COMMON_EXTERN uint32_t encodedSize() const;
    00137     QPID_COMMON_EXTERN uint32_t bodySize() const;
    00138     QPID_COMMON_EXTERN void print(std::ostream& out) const;
    00139 }; /* class DeliveryProperties */
    00140
    00141 }}
    00142 #endif