Jeff Thompson | fa30664 | 2013-06-17 15:06:57 -0700 | [diff] [blame] | 1 | /* -*- 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 Thompson | 4454bf7 | 2013-06-18 13:33:12 -0700 | [diff] [blame] | 15 | #include <boost/shared_ptr.hpp> |
Jeff Thompson | fa30664 | 2013-06-17 15:06:57 -0700 | [diff] [blame] | 16 | |
| 17 | namespace ndn { |
| 18 | |
| 19 | namespace wire { class Base; } |
| 20 | |
Jeff Thompson | fa30664 | 2013-06-17 15:06:57 -0700 | [diff] [blame] | 21 | /** |
| 22 | * @brief Pure virtual class providing an interface to work with signatures for NDN data packets |
| 23 | */ |
| 24 | class Signature |
| 25 | { |
| 26 | public: |
| 27 | /** |
| 28 | * @brief Virtual destructor |
| 29 | */ |
| 30 | virtual |
| 31 | ~Signature () { } |
| 32 | |
| 33 | /** |
| 34 | * @brief A double dispatch pattern to call the right wireFormatter method to format signature |
| 35 | * @param os reference to output stream |
| 36 | * @param wireFormatter a reference to a wireFormatter object |
| 37 | * @param userData any user-specific data |
| 38 | */ |
| 39 | virtual void |
| 40 | doubleDispatch (std::ostream &os, wire::Base &wireFormatter, void *userData) const = 0; |
| 41 | }; |
| 42 | |
| 43 | } // ndn |
| 44 | |
| 45 | #endif // NDN_SIGNATURE_H |