cocos2d-x  3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DataVisitor Class Referenceabstract

Visitor that helps to perform action that depends on polymorphic object type. More...

#include <CCDataVisitor.h>

Inheritance diagram for DataVisitor:
PrettyPrinter

Public Member Functions

virtual ~DataVisitor ()
virtual void visitObject (const Ref *p)=0
 default method, called from non-overloaded methods and for unrecognized objects More...
 
local visitObject ( local p)
 default method, called from non-overloaded methods and for unrecognized objects More...
 
virtual void visit (const __Bool *p)
local visit ( local p)
virtual void visit (const __Integer *p)
local visit ( local p)
virtual void visit (const __Float *p)
var visit ( var p)
local visit ( local p)
virtual void visit (const __Double *p)
local visit ( local p)
virtual void visit (const __String *p)
var visit ( var p)
local visit ( local p)
virtual void visit (const __Array *p)
virtual void visit (const __Dictionary *p)
local visit ( local p)
virtual void visit (const __Set *p)
var visit ( var p)
local visit ( local p)

Detailed Description

Visitor that helps to perform action that depends on polymorphic object type.

Use cases:

  • data serialization,
  • pretty printing of Ref*
  • safe value reading from Array, __Dictionary, Set

Usage:

  1. subclass DataVisitor
  2. overload visit() methods for object that you need to handle
  3. handle other objects in visitObject()
  4. pass your visitor to Object::acceptVisitor()

Constructor & Destructor Documentation

virtual ~DataVisitor ( )
inlinevirtual

Member Function Documentation

virtual void visit ( const __Bool p)
virtual

Reimplemented in PrettyPrinter.

var visit ( var  p)
virtual

Reimplemented in PrettyPrinter.

local visit ( local  p)
virtual

Reimplemented in PrettyPrinter.

virtual void visit ( const __Integer p)
virtual

Reimplemented in PrettyPrinter.

var visit ( var  p)
virtual

Reimplemented in PrettyPrinter.

local visit ( local  p)
virtual

Reimplemented in PrettyPrinter.

virtual void visit ( const __Float p)
virtual

Reimplemented in PrettyPrinter.

var visit ( var  p)
virtual

Reimplemented in PrettyPrinter.

local visit ( local  p)
virtual

Reimplemented in PrettyPrinter.

virtual void visit ( const __Double p)
virtual

Reimplemented in PrettyPrinter.

var visit ( var  p)
virtual

Reimplemented in PrettyPrinter.

local visit ( local  p)
virtual

Reimplemented in PrettyPrinter.

virtual void visit ( const __String p)
virtual

Reimplemented in PrettyPrinter.

var visit ( var  p)
virtual

Reimplemented in PrettyPrinter.

local visit ( local  p)
virtual

Reimplemented in PrettyPrinter.

virtual void visit ( const __Array p)
virtual

Reimplemented in PrettyPrinter.

var visit ( var  p)
virtual

Reimplemented in PrettyPrinter.

local visit ( local  p)
virtual

Reimplemented in PrettyPrinter.

virtual void visit ( const __Dictionary p)
virtual

Reimplemented in PrettyPrinter.

var visit ( var  p)
virtual

Reimplemented in PrettyPrinter.

local visit ( local  p)
virtual

Reimplemented in PrettyPrinter.

virtual void visit ( const __Set p)
virtual

Reimplemented in PrettyPrinter.

var visit ( var  p)
virtual

Reimplemented in PrettyPrinter.

local visit ( local  p)
virtual

Reimplemented in PrettyPrinter.

virtual void visitObject ( const Ref p)
pure virtual

default method, called from non-overloaded methods and for unrecognized objects

Implemented in PrettyPrinter.

var visitObject ( var  p)
pure virtual

default method, called from non-overloaded methods and for unrecognized objects

Implemented in PrettyPrinter.

local visitObject ( local  p)
pure virtual

default method, called from non-overloaded methods and for unrecognized objects

Implemented in PrettyPrinter.


The documentation for this class was generated from the following file: