summaryrefslogtreecommitdiff
path: root/TAO/tao/GIOP_Fragmentation_Strategy.h
blob: 47ff70e48651f36f91fb23301c5646b0d03655db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// -*- C++ -*-

//=============================================================================
/**
 *  @file    GIOP_Fragmentation_Strategy.h
 *
 *  @author  Ossama Othman <ossama@dre.vanderbilt.edu>
 */
//=============================================================================

#ifndef TAO_GIOP_FRAGMENTATION_STRATEGY_H
#define TAO_GIOP_FRAGMENTATION_STRATEGY_H

#include /**/ "ace/pre.h"

#include /**/ "tao/TAO_Export.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "tao/orbconf.h"
#include "ace/CDR_Base.h"

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

class TAO_OutputCDR;

/**
 * @class TAO_GIOP_Fragmenation_Strategy
 *
 * @brief Abstract base class that defines TAO fragmentation strategy
 *        interface.
 *
 * GIOP message fragmentation is deferred to a fragmentation strategy
 */
class TAO_Export TAO_GIOP_Fragmentation_Strategy
{
public:
  /// Constructor
  TAO_GIOP_Fragmentation_Strategy () {}

  /// Destructor.
  virtual ~TAO_GIOP_Fragmentation_Strategy ();

  /// Fragment the (potentially partially) encoded GIOP message.
  /**
   * Fragmentation the contents of the CDR output stream @a cdr into
   * smaller chunks of data of size that fits within the configured
   * ORB fragmentation threshold, and send each fragment "over the
   * wire."
   *
   * @note Fragmentation will only occur if the CDR stream length will
   *       surpass the configured fragmentation threshold when
   *       marshaling the pending set of data.
   *
   * @param cdr               Output CDR stream.
   * @param pending_alignment Size of alignment boundary for next data
   *                          to be marshaled (e.g. 4 for a
   *                          CORBA::ULong).
   * @param pending_length    Size of next data to be marshaled (e.g. 2
   *                          for a CORBA::UShort).
   *
   * @return Zero on success.
   */
  virtual int fragment (TAO_OutputCDR & cdr,
                        ACE_CDR::ULong pending_alignment,
                        ACE_CDR::ULong pending_length) = 0;

private:
  TAO_GIOP_Fragmentation_Strategy (TAO_GIOP_Fragmentation_Strategy const &) = delete;
  void operator= (TAO_GIOP_Fragmentation_Strategy const &) = delete;
  TAO_GIOP_Fragmentation_Strategy (TAO_GIOP_Fragmentation_Strategy&&) = delete;
  void operator= (TAO_GIOP_Fragmentation_Strategy &&) = delete;
};

TAO_END_VERSIONED_NAMESPACE_DECL

#include /**/ "ace/post.h"

#endif  /* TAO_GIOP_FRAGMENTATION_STRATEGY_H */