00001 
00002 
00003 
00004 
00005 
00006 
00007 #ifndef COH_BINARY_HPP
00008 #define COH_BINARY_HPP
00009 
00010 #include "coherence/lang.ns"
00011 
00012 #include "coherence/io/AbstractOctetArrayReadBuffer.hpp"
00013 #include "coherence/io/ReadBuffer.hpp"
00014 #include "coherence/util/BinaryWriteBuffer.hpp"
00015 
00016 COH_OPEN_NAMESPACE2(coherence,util)
00017 
00018 using coherence::io::AbstractOctetArrayReadBuffer;
00019 using coherence::io::ReadBuffer;
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 class COH_EXPORT Binary
00028     : public cloneable_spec<Binary,
00029         extends<AbstractOctetArrayReadBuffer> >
00030     {
00031     friend class factory<Binary>;
00032 
00033     
00034 
00035     private:
00036 
00037 
00038 
00039 
00040 
00041         Binary();
00042 
00043 
00044 
00045 
00046 
00047 
00048 
00049 
00050 
00051 
00052 
00053 
00054 
00055 
00056         Binary(Array<octet_t>::View vab, size32_t of = 0, size32_t cb = npos);
00057 
00058 
00059 
00060 
00061 
00062 
00063 
00064 
00065         Binary(BinaryWriteBuffer::View vBuf);
00066 
00067 
00068 
00069 
00070         Binary(const Binary& that);
00071 
00072 
00073     
00074 
00075     public:
00076 
00077 
00078 
00079 
00080 
00081 
00082 
00083 
00084 
00085 
00086 
00087 
00088 
00089         virtual int32_t calculateNaturalPartition(int32_t cPartitions) const;
00090 
00091 
00092     
00093 
00094     public:
00095 
00096 
00097 
00098         virtual size32_t hashCode() const;
00099 
00100 
00101 
00102 
00103         virtual bool equals(Object::View v) const;
00104 
00105 
00106 
00107 
00108         virtual bool isImmutable() const;
00109 
00110 
00111 
00112 
00113         virtual TypedHandle<const String> toString() const;
00114 
00115 
00116     
00117 
00118     protected:
00119 
00120 
00121 
00122         virtual void updateLength(size32_t cb);
00123 
00124 
00125 
00126 
00127         virtual ReadBuffer::View instantiateReadBuffer(size32_t of,
00128                 size32_t cb) const;
00129     };
00130 
00131 COH_CLOSE_NAMESPACE2
00132 
00133 #endif // COH_BINARY_HPP