/home/aconway/svn/qpid/cpp/src/qpid/broker/Content.h

00001 /*
00002  *
00003  * Licensed to the Apache Software Foundation (ASF) under one
00004  * or more contributor license agreements.  See the NOTICE file
00005  * distributed with this work for additional information
00006  * regarding copyright ownership.  The ASF licenses this file
00007  * to you under the Apache License, Version 2.0 (the
00008  * "License"); you may not use this file except in compliance
00009  * with the License.  You may obtain a copy of the License at
00010  * 
00011  *   http://www.apache.org/licenses/LICENSE-2.0
00012  * 
00013  * Unless required by applicable law or agreed to in writing,
00014  * software distributed under the License is distributed on an
00015  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00016  * KIND, either express or implied.  See the License for the
00017  * specific language governing permissions and limitations
00018  * under the License.
00019  *
00020  */
00021 #ifndef _Content_
00022 #define _Content_
00023 
00024 #include <boost/function.hpp>
00025 
00026 #include "qpid/framing/AMQContentBody.h"
00027 #include "qpid/framing/Buffer.h"
00028 #include "qpid/framing/OutputHandler.h"
00029 
00030 namespace qpid {
00031 
00032 namespace framing {
00033 class ChannelAdapter;
00034 }
00035 
00036 namespace broker {
00037 class Content{
00038   public:
00039     typedef std::string DataBlock;
00040     typedef boost::function1<void, const DataBlock&> SendFn;
00041 
00042     virtual ~Content(){}
00043     
00045     virtual void add(framing::AMQContentBody::shared_ptr data) = 0;
00046 
00048     virtual uint32_t size() = 0;
00049 
00055     virtual void send(framing::ChannelAdapter& channel, uint32_t framesize) = 0;
00056 
00057     //FIXME aconway 2007-02-07: This is inconsistently implemented
00058     //find out what is needed.
00059     virtual void encode(qpid::framing::Buffer& buffer) = 0;
00060 };
00061 }}
00062 
00063 
00064 #endif

Generated on Tue Apr 17 14:22:03 2007 for Qpid by  doxygen 1.4.7