blob: 8290fbe7b5a32de4bf6ee992f72206e953daed8a [file] [log] [blame]
Jeff Thompsonfa306642013-06-17 15:06:57 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2/*
3 * Copyright (c) 2013, Regents of the University of California
4 * Alexander Afanasyev
5 *
6 * BSD license, See the LICENSE file for more information
7 *
8 * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
9 */
10
11#ifndef NDN_TRIE_PAYLOAD_TRAITS_POINTER_H
12#define NDN_TRIE_PAYLOAD_TRAITS_POINTER_H
13
14namespace ndn {
15namespace trie {
16
17template<typename Payload, typename BasePayload = Payload>
18struct pointer_payload_traits
19{
20 typedef Payload payload_type; // general type of the payload
21 typedef Payload* storage_type; // how the payload is actually stored
22 typedef Payload* insert_type; // what parameter is inserted
23
24 typedef Payload* return_type; // what is returned on access
25 typedef const Payload* const_return_type; // what is returned on const access
26
27 typedef BasePayload* base_type; // base type of the entry (when implementation details need to be hidden)
28 typedef const BasePayload* const_base_type; // const base type of the entry (when implementation details need to be hidden)
29
30 static Payload* empty_payload;
31};
32
33template<typename Payload, typename BasePayload>
34Payload*
35pointer_payload_traits<Payload, BasePayload>::empty_payload = NULL;
36
37} // trie
38} // ndn
39
40#endif // NDN_TRIE_PAYLOAD_TRAITS_POINTER_H