00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file GIOP_Fragmentation_Strategy.h 00006 * 00007 * $Id: GIOP_Fragmentation_Strategy.h 79012 2007-07-24 14:21:05Z johnnyw $ 00008 * 00009 * @author Ossama Othman <ossama@dre.vanderbilt.edu> 00010 */ 00011 //============================================================================= 00012 00013 #ifndef TAO_GIOP_FRAGMENTATION_STRATEGY_H 00014 #define TAO_GIOP_FRAGMENTATION_STRATEGY_H 00015 00016 #include /**/ "ace/pre.h" 00017 00018 #include /**/ "tao/TAO_Export.h" 00019 00020 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00021 # pragma once 00022 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00023 00024 #include "tao/orbconf.h" 00025 #include "ace/CDR_Base.h" 00026 00027 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00028 00029 class TAO_OutputCDR; 00030 00031 /** 00032 * @class TAO_GIOP_Fragmenation_Strategy 00033 * 00034 * @brief Abstract base class that defines TAO fragmentation strategy 00035 * interface. 00036 * 00037 * GIOP message fragmentation is deferred to a fragmentation strategy 00038 */ 00039 class TAO_Export TAO_GIOP_Fragmentation_Strategy 00040 { 00041 public: 00042 /// Constructor 00043 TAO_GIOP_Fragmentation_Strategy (void) {} 00044 00045 /// Destructor. 00046 virtual ~TAO_GIOP_Fragmentation_Strategy (void); 00047 00048 /// Fragment the (potentially partially) encoded GIOP message. 00049 /** 00050 * Fragmentation the contents of the CDR output stream @a cdr into 00051 * smaller chunks of data of size that fits within the configured 00052 * ORB fragmentation threshold, and send each fragment "over the 00053 * wire." 00054 * 00055 * @note Fragmentation will only occur if the CDR stream length will 00056 * surpass the configured fragmentation threshold when 00057 * marshaling the pending set of data. 00058 * 00059 * @param cdr Output CDR stream. 00060 * @param pending_alignment Size of alignment boundary for next data 00061 * to be marshaled (e.g. 4 for a 00062 * CORBA::ULong). 00063 * @param pending_length Size of next data to be marshaled (e.g. 2 00064 * for a CORBA::UShort). 00065 * 00066 * @return Zero on success. 00067 */ 00068 virtual int fragment (TAO_OutputCDR & cdr, 00069 ACE_CDR::ULong pending_alignment, 00070 ACE_CDR::ULong pending_length) = 0; 00071 00072 private: 00073 00074 // Disallow copying and assignment. 00075 TAO_GIOP_Fragmentation_Strategy (TAO_GIOP_Fragmentation_Strategy const &); 00076 void operator= (TAO_GIOP_Fragmentation_Strategy const &); 00077 00078 }; 00079 00080 TAO_END_VERSIONED_NAMESPACE_DECL 00081 00082 #include /**/ "ace/post.h" 00083 00084 #endif /* TAO_GIOP_FRAGMENTATION_STRATEGY_H */