summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/PortableGroup/Fragments_Cleanup_Strategy.h
blob: d8bd18cf11c990aae25c646fc4e0c7a8598da0ba (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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
// -*- C++ -*-

// ================================================================
/**
 *  @file   Fragments_Cleanup_Strategy.h
 *
 *  @author Vladimir Zykov <vz@prismtech.com>
 */
// ================================================================

#ifndef TAO_FRAGMENTS_CLEANUP_STRATEGY_H
#define TAO_FRAGMENTS_CLEANUP_STRATEGY_H

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

#include "orbsvcs/PortableGroup/portablegroup_export.h"

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

#include "orbsvcs/PortableGroup/UIPMC_Mcast_Transport.h"

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

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

// ****************************************************************

namespace TAO_PG
{

  /**
   * @class Fragments_Cleanup_Strategy
   *
   * @brief The base class for all cleanup strategies
   *
   * This class is used by TAO_UIPMC_Mcast_Transport for cleaning
   * received fragments.
   */
  class TAO_PortableGroup_Export Fragments_Cleanup_Strategy
  {
  public:
    /// The constructor
    Fragments_Cleanup_Strategy (int bound);

    /// The destructor
    virtual ~Fragments_Cleanup_Strategy (void);

    /// Sub-classes must implement these methods
    virtual void cleanup (TAO_UIPMC_Mcast_Transport::Packets_Map &) = 0;

  protected:
    /// The bound that triggers a cleanup.
    int bound_;
  };

  /**
   * @class Time_Bound_Fragments_Cleanup_Strategy
   *
   * @brief Cleanup if a message cannot reassemble for a long time.
   */
  class TAO_PortableGroup_Export Time_Bound_Fragments_Cleanup_Strategy
    : public Fragments_Cleanup_Strategy
  {
  public:
    /// The constructor
    Time_Bound_Fragments_Cleanup_Strategy (int bound);

    virtual void cleanup (TAO_UIPMC_Mcast_Transport::Packets_Map &packets);
  };

  /**
   * @class Number_Bound_Fragments_Cleanup_Strategy
   *
   * @brief Cleanup if there are too many messages cannot reassemble.
   */
  class TAO_PortableGroup_Export Number_Bound_Fragments_Cleanup_Strategy
    : public Fragments_Cleanup_Strategy
  {
  public:
    /// The constructor
    Number_Bound_Fragments_Cleanup_Strategy (int bound);

    virtual void cleanup (TAO_UIPMC_Mcast_Transport::Packets_Map &packets);
  };

  /**
   * @class Memory_Bound_Fragments_Cleanup_Strategy
   *
   * @brief Cleanup if non-reassembled messages take too much memory.
   */
  class TAO_PortableGroup_Export Memory_Bound_Fragments_Cleanup_Strategy
    : public Fragments_Cleanup_Strategy
  {
  public:
    /// The constructor
    Memory_Bound_Fragments_Cleanup_Strategy (int bound);

    virtual void cleanup (TAO_UIPMC_Mcast_Transport::Packets_Map &packets);
  };
} // namespace TAO_PG

TAO_END_VERSIONED_NAMESPACE_DECL

#if defined (__ACE_INLINE__)
# include "orbsvcs/PortableGroup/Fragments_Cleanup_Strategy.inl"
#endif /* __ACE_INLINE__ */

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