#ifndef PCC_TRAVELER_HH #define PCC_TRAVELER_HH #include #include "Type.hh" #include "TypeIdentifier.hh" namespace pcc { enum class TravelPart { PREFIX, NAME_BEGIN, NAME_END, DESCRPTION_BEGIN, DESCRPTION_END, CHILD_BEGIN, CHILD_END, LAST_CHILD_BEGIN, LAST_CHILD_END, END }; class BaseNode; class Traveler { public: Traveler(std::ostream& out); void Travel(std::shared_ptr root); virtual Traveler& operator<<(TravelPart part) = 0; Traveler& operator<<(std::shared_ptr type); Traveler& operator<<(std::shared_ptr identifier); template Traveler& operator<<(T value) { out_ << value; return *this; } protected: virtual void PreTravel(); virtual void PostTravel(); std::ostream& out_; }; } // namespace pcc #endif // !PCC_TRAVELER_HH