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