summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/PSS/PSDL_String.h
blob: 51bb476c9feb2a3d44d6fb6e42d455136be928d2 (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
/* -*- C++ -*- */

//=============================================================================
/**
 *  @file    PSDL_String.h
 *
 *  $Id$
 *
 *  @author Priyanka Gontla <gontla_p@ociweb.com>
 */
//=============================================================================

#ifndef TAO_PSDL_STRING_H
#define TAO_PSDL_STRING_H
#include "ace/pre.h"

#include "psdl_export.h"

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

#include "PSDL_Datastore.h"

/**
 * @class TAO_PSDL_String
 *
 * @brief Wrapper for the ACE_CString to facilitate saving the string
 * persistently.
 *
 *
 **/

class ACE_Allocator;

class TAO_PSDL_Export TAO_PSDL_String
{
public:

  /// Constructor.
  TAO_PSDL_String (void);

  /// Constructor.
  TAO_PSDL_String (ACE_Allocator *persistent_allocator);

  /// Copy constructor.
  TAO_PSDL_String (const TAO_PSDL_String & rhs);

  /// Destructor.
  ~TAO_PSDL_String (void);

  /// Assignment operator.
  void operator= (const TAO_PSDL_String & rhs);

  // Conversion operator (assignment)
  void operator= (const ACE_CString & rhs);

  /// Returns a hash value for this string.
  u_long hash (void) const;

  // Conversion operators (cast)
  // (caller owns storage of return values)
  operator ACE_CString *() const;

  operator ACE_CString *();

  // Persistent allocator.
  ACE_Allocator * allocator_;

  // Persistent buffer.
  const char * buffer_;

  // Length of the persistent buffer.
  CORBA::ULong length_;
};


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