Line data Source code
1 : /**
2 : * @file BItemVisitor.h
3 : * @copyright (c) 2014 by Petr Zemek (s3rvac@gmail.com) and contributors
4 : * @license BSD, see the @c LICENSE file for more details
5 : * @brief Base class for all visitors of the BItem subclasses.
6 : */
7 :
8 : #ifndef BENCODING_BITEMVISITOR_H
9 : #define BENCODING_BITEMVISITOR_H
10 :
11 : namespace bencoding {
12 :
13 : class BDictionary;
14 : class BInteger;
15 : class BList;
16 : class BString;
17 :
18 : /**
19 : * @brief Base class for all visitors of the BItem subclasses.
20 : *
21 : * Implements the <a
22 : * href="http://en.wikipedia.org/wiki/Visitor_design_pattern">Visitor design
23 : * pattern</a>.
24 : */
25 50 : class BItemVisitor {
26 : public:
27 : virtual ~BItemVisitor();
28 :
29 : virtual void visit(BDictionary *bDictionary) = 0;
30 : virtual void visit(BInteger *bInteger) = 0;
31 : virtual void visit(BList *blist) = 0;
32 : virtual void visit(BString *bString) = 0;
33 :
34 : protected:
35 : BItemVisitor();
36 : };
37 :
38 : } // namespace bencoding
39 :
40 : #endif
|