summaryrefslogtreecommitdiff
path: root/trunk/TAO/tests/Sequence_Unit_Tests/mock_array.hpp
blob: c864d59dbf2870f7068d6fb40d0bf1ec974a1277 (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
#ifndef guard_mock_array_hpp
#define guard_mock_array_hpp
#include /**/ "ace/pre.h"
/**
 * @file
 *
 * @brief Mock an IDL-generated array
 *
 * $Id$
 *
 * @author Carlos O'Ryan
 */
#include "testing_counters.hpp"

#include <algorithm>

typedef unsigned long my_array[5];
typedef unsigned long my_array_slice;
struct my_array_tag {};

namespace TAO
{

template<typename T, typename T_slice, typename TAG>
struct Array_Traits;

template<>
struct Array_Traits<my_array,my_array_slice,my_array_tag>
{
  static my_array_slice * alloc();
  static void free(my_array_slice * _tao_slice);
  static my_array_slice * dup(my_array_slice const * _tao_source);
  static void copy(
      my_array_slice * _tao_destination,
      my_array_slice const * _tao_source);

  // TODO This is a new function
  static void zero(
      my_array_slice * _tao_slice);

};

}

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