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

gen/qpid/framing/StreamProperties.h

Go to the documentation of this file.
00001 #ifndef QPID_FRAMING_STREAMPROPERTIES_H
00002 #define QPID_FRAMING_STREAMPROPERTIES_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 
00034 namespace qpid {
00035 namespace framing {
00036 
00037 class StreamProperties  {
00038     string contentType;
00039     string contentEncoding;
00040     FieldTable headers;
00041     uint8_t priority;
00042     uint64_t timestamp;
00043     uint16_t flags;
00044 public:
00045     static const uint16_t TYPE = 2561;
00046     StreamProperties(
00047         const string& _contentType,
00048         const string& _contentEncoding,
00049         const FieldTable& _headers,
00050         uint8_t _priority,
00051         uint64_t _timestamp) : 
00052         contentType(_contentType),
00053         contentEncoding(_contentEncoding),
00054         headers(_headers),
00055         priority(_priority),
00056         timestamp(_timestamp),
00057         flags(0){
00058         flags |= (1 << 8);
00059         flags |= (1 << 9);
00060         flags |= (1 << 10);
00061         flags |= (1 << 11);
00062         flags |= (1 << 12);
00063     }
00064     StreamProperties()  : priority(0), timestamp(0), flags(0) {}
00065     
00066     void setContentType(const string& _contentType);
00067     const string& getContentType() const;
00068     bool hasContentType() const;
00069     void clearContentTypeFlag();
00070     void setContentEncoding(const string& _contentEncoding);
00071     const string& getContentEncoding() const;
00072     bool hasContentEncoding() const;
00073     void clearContentEncodingFlag();
00074     void setHeaders(const FieldTable& _headers);
00075     const FieldTable& getHeaders() const;
00076     FieldTable& getHeaders();
00077     bool hasHeaders() const;
00078     void clearHeadersFlag();
00079     void setPriority(uint8_t _priority);
00080     uint8_t getPriority() const;
00081     bool hasPriority() const;
00082     void clearPriorityFlag();
00083     void setTimestamp(uint64_t _timestamp);
00084     uint64_t getTimestamp() const;
00085     bool hasTimestamp() const;
00086     void clearTimestampFlag();
00087     friend std::ostream& operator<<(std::ostream&, const StreamProperties&);
00088     void encode(Buffer&) const;
00089     void decode(Buffer&, uint32_t=0);
00090     void encodeStructBody(Buffer&) const;
00091     void decodeStructBody(Buffer&, uint32_t=0);
00092     uint32_t encodedSize() const;
00093     uint32_t bodySize() const;
00094     void print(std::ostream& out) const;
00095 }; /* class StreamProperties */
00096 
00097 }}
00098 #endif  

Qpid C++ API Reference
Generated on Tue Dec 8 15:39:47 2009 for Qpid C++ Client API by doxygen 1.4.7