blob: 13686633eede1802b8e00d0994722f56b063255b [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_SIGNATURE_H
12#define NDN_SIGNATURE_H
13
14#include <iostream>
Jeff Thompson4454bf72013-06-18 13:33:12 -070015#include <boost/shared_ptr.hpp>
Jeff Thompsonfa306642013-06-17 15:06:57 -070016
17namespace ndn {
18
19namespace wire { class Base; }
20
Jeff Thompson4454bf72013-06-18 13:33:12 -070021class Signature;
22typedef boost::shared_ptr<Signature> SignaturePtr;
23typedef boost::shared_ptr<const Signature> ConstSignaturePtr;
24
Jeff Thompsonfa306642013-06-17 15:06:57 -070025/**
26 * @brief Pure virtual class providing an interface to work with signatures for NDN data packets
27 */
28class Signature
29{
30public:
31 /**
32 * @brief Virtual destructor
33 */
34 virtual
35 ~Signature () { }
36
37 /**
38 * @brief A double dispatch pattern to call the right wireFormatter method to format signature
39 * @param os reference to output stream
40 * @param wireFormatter a reference to a wireFormatter object
41 * @param userData any user-specific data
42 */
43 virtual void
44 doubleDispatch (std::ostream &os, wire::Base &wireFormatter, void *userData) const = 0;
45};
46
47} // ndn
48
49#endif // NDN_SIGNATURE_H