cocos2d-x  3.0-alpha0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DataReaderHelper Class Reference

#include <CCDataReaderHelper.h>

Inheritance diagram for DataReaderHelper:
Object

Public Member Functions

 DataReaderHelper ()
 ctor ()
 ~DataReaderHelper ()
void addDataFromFile (const char *filePath)
void addDataFromFileAsync (const char *filePath, Object *target, SEL_SCHEDULE selector)
void addDataAsyncCallBack (float dt)

Static Public Member Functions

static CC_DEPRECATED_ATTRIBUTE
DataReaderHelper
sharedDataReaderHelper ()
local sharedDataReaderHelper ()
static DataReaderHelpergetInstance ()
local getInstance ()
static void setPositionReadScale (float scale)
 Scale the position data, used for multiresolution adapter It won't effect the data already read. More...
 
local setPositionReadScale ( local scale)
 Scale the position data, used for multiresolution adapter It won't effect the data already read. More...
 
static float getPositionReadScale ()
var getPositionReadScale ()
local getPositionReadScale ()
static void purge ()
var purge ()
local purge ()
static void clear ()
var clear ()
local clear ()
static void addDataFromCache (const char *pFileContent, DataInfo *dataInfo=NULL)
 Translate XML export from Dragon Bone flash tool to datas, and save them. More...
 
var addDataFromCache ( var pFileContent, var NULL)
 Translate XML export from Dragon Bone flash tool to datas, and save them. More...
 
local addDataFromCache ( local pFileContent, local NULL)
 Translate XML export from Dragon Bone flash tool to datas, and save them. More...
 
static ArmatureDatadecodeArmature (tinyxml2::XMLElement *armatureXML)
 Decode Armature Datas from xml export from Dragon Bone flash tool. More...
 
var decodeArmature ( var armatureXML)
 Decode Armature Datas from xml export from Dragon Bone flash tool. More...
 
local decodeArmature ( local armatureXML)
 Decode Armature Datas from xml export from Dragon Bone flash tool. More...
 
static BoneDatadecodeBone (tinyxml2::XMLElement *boneXML, tinyxml2::XMLElement *parentXML)
local decodeBone ( local boneXML, local parentXML)
static DisplayDatadecodeBoneDisplay (tinyxml2::XMLElement *displayXML)
local decodeBoneDisplay ( local displayXML)
static AnimationDatadecodeAnimation (tinyxml2::XMLElement *animationXML)
 Decode ArmatureAnimation Datas from xml export from Dragon Bone flash tool. More...
 
local decodeAnimation ( local animationXML)
 Decode ArmatureAnimation Datas from xml export from Dragon Bone flash tool. More...
 
static MovementDatadecodeMovement (tinyxml2::XMLElement *movementXML, ArmatureData *armatureData)
local decodeMovement ( local movementXML, local armatureData)
static MovementBoneDatadecodeMovementBone (tinyxml2::XMLElement *movBoneXml, tinyxml2::XMLElement *parentXml, BoneData *boneData)
local decodeMovementBone ( local movBoneXml, local parentXml, local boneData)
static FrameDatadecodeFrame (tinyxml2::XMLElement *frameXML, tinyxml2::XMLElement *parentFrameXml, BoneData *boneData)
static TextureDatadecodeTexture (tinyxml2::XMLElement *textureXML)
 Decode Texture Datas from xml export from Dragon Bone flash tool. More...
 
static ContourDatadecodeContour (tinyxml2::XMLElement *contourXML)
 Decode Contour Datas from xml export from Dragon Bone flash tool. More...
 
local decodeContour ( local contourXML)
 Decode Contour Datas from xml export from Dragon Bone flash tool. More...
 
static void addDataFromJsonCache (const char *fileContent, DataInfo *dataInfo=NULL)
var addDataFromJsonCache ( var fileContent, var NULL)
local addDataFromJsonCache ( local fileContent, local NULL)
static ArmatureDatadecodeArmature (cs::JsonDictionary &json)
var decodeArmature ( var json)
local decodeArmature ( local json)
static BoneDatadecodeBone (cs::JsonDictionary &json)
local decodeBone ( local json)
static DisplayDatadecodeBoneDisplay (cs::JsonDictionary &json)
local decodeBoneDisplay ( local json)
static AnimationDatadecodeAnimation (cs::JsonDictionary &json)
local decodeAnimation ( local json)
static MovementDatadecodeMovement (cs::JsonDictionary &json)
local decodeMovement ( local json)
static MovementBoneDatadecodeMovementBone (cs::JsonDictionary &json)
local decodeMovementBone ( local json)
static FrameDatadecodeFrame (cs::JsonDictionary &json)
local decodeFrame ( local json)
static TextureDatadecodeTexture (cs::JsonDictionary &json)
static ContourDatadecodeContour (cs::JsonDictionary &json)
local decodeContour ( local json)
static void decodeNode (BaseData *node, cs::JsonDictionary &json)
var decodeNode ( var node, var json)
local decodeNode ( local node, local json)

Protected Types

enum  ConfigType { DragonBone_XML, CocoStudio_JSON }
 

Protected Member Functions

void loadData ()

Protected Attributes

std::condition_variable _sleepCondition
std::thread * _loadingThread
var _loadingThread
local _loadingThread
std::mutex _sleepMutex
var _sleepMutex
local _sleepMutex
std::mutex _asyncStructQueueMutex
var _asyncStructQueueMutex
local _asyncStructQueueMutex
std::mutex _dataInfoMutex
std::mutex _addDataMutex
unsigned long _asyncRefCount
var _asyncRefCount
local _asyncRefCount
unsigned long _asyncRefTotalCount
var _asyncRefTotalCount
local _asyncRefTotalCount
bool need_quit
var need_quit
local need_quit
std::queue< AsyncStruct * > * _asyncStructQueue
var _asyncStructQueue
local _asyncStructQueue
std::queue< DataInfo * > * _dataQueue

Static Protected Attributes

static DataReaderHelper_dataReaderHelper
var _dataReaderHelper
local _dataReaderHelper

Additional Inherited Members

- Private Member Functions inherited from Object
 Object ()
 Constructor. More...
 
virtual ~Object ()
void release ()
 Release the ownership immediately. More...
 
void retain ()
 Retains the ownership. More...
 
Objectautorelease ()
 Release the ownership sometime soon automatically. More...
 
bool isSingleReference () const
 Returns a boolean value that indicates whether there is only one reference to the object. More...
 
unsigned int retainCount () const
 Returns the object's current reference count. More...
 
virtual bool isEqual (const Object *object)
 Returns a boolean value that indicates whether this object and a given object are equal. More...
 
virtual void acceptVisitor (DataVisitor &visitor)
virtual void update (float dt)
- Private Attributes inherited from Object
unsigned int _ID
 object id, ScriptSupport need public _ID More...
 
int _luaID
 Lua reference id. More...
 
unsigned int _reference
 count of references More...
 
var _reference
 count of references More...
 
local _reference
 count of references More...
 
unsigned int _autoReleaseCount
 count of autorelease More...
 
var _autoReleaseCount
 count of autorelease More...
 
local _autoReleaseCount
 count of autorelease More...
 

Member Enumeration Documentation

enum ConfigType
protected
Enumerator
DragonBone_XML 
CocoStudio_JSON 
var ConfigType
protected
Enumerator
DragonBone_XML 
CocoStudio_JSON 
local ConfigType
protected
Enumerator
DragonBone_XML 
CocoStudio_JSON 

Constructor & Destructor Documentation

var ctor ( )
local DataReaderHelper ( )

Member Function Documentation

void addDataAsyncCallBack ( float  dt)
var addDataAsyncCallBack ( var  dt)
local addDataAsyncCallBack ( local  dt)
static void addDataFromCache ( const char *  pFileContent,
DataInfo dataInfo = NULL 
)
static

Translate XML export from Dragon Bone flash tool to datas, and save them.

When you add a new xml, the data already saved will be keeped.

Parameters
xmlPathThe cache of the xml
var addDataFromCache ( var  pFileContent,
var  dataInfo = NULL 
)
static

Translate XML export from Dragon Bone flash tool to datas, and save them.

When you add a new xml, the data already saved will be keeped.

Parameters
xmlPathThe cache of the xml
local addDataFromCache ( local  pFileContent,
local  dataInfo = NULL 
)
static

Translate XML export from Dragon Bone flash tool to datas, and save them.

When you add a new xml, the data already saved will be keeped.

Parameters
xmlPathThe cache of the xml
void addDataFromFile ( const char *  filePath)
var addDataFromFile ( var  filePath)
local addDataFromFile ( local  filePath)
void addDataFromFileAsync ( const char *  filePath,
Object target,
SEL_SCHEDULE  selector 
)
var addDataFromFileAsync ( var  filePath,
var  target,
var  selector 
)
local addDataFromFileAsync ( local  filePath,
local  target,
local  selector 
)
static void addDataFromJsonCache ( const char *  fileContent,
DataInfo dataInfo = NULL 
)
static
var addDataFromJsonCache ( var  fileContent,
var  dataInfo = NULL 
)
static
local addDataFromJsonCache ( local  fileContent,
local  dataInfo = NULL 
)
static
static void clear ( )
static
var clear ( )
static
local clear ( )
static
static AnimationData*
decodeAnimation
( tinyxml2::XMLElement animationXML)
static

Decode ArmatureAnimation Datas from xml export from Dragon Bone flash tool.

var decodeAnimation ( var  animationXML)
static

Decode ArmatureAnimation Datas from xml export from Dragon Bone flash tool.

local decodeAnimation ( local  animationXML)
static

Decode ArmatureAnimation Datas from xml export from Dragon Bone flash tool.

static AnimationData*
decodeAnimation
( cs::JsonDictionary json)
static
var decodeAnimation ( var  json)
static
local decodeAnimation ( local  json)
static
static ArmatureData* decodeArmature ( tinyxml2::XMLElement armatureXML)
static

Decode Armature Datas from xml export from Dragon Bone flash tool.

var decodeArmature ( var  armatureXML)
static

Decode Armature Datas from xml export from Dragon Bone flash tool.

local decodeArmature ( local  armatureXML)
static

Decode Armature Datas from xml export from Dragon Bone flash tool.

static ArmatureData* decodeArmature ( cs::JsonDictionary json)
static
var decodeArmature ( var  json)
static
local decodeArmature ( local  json)
static
static BoneData* decodeBone ( tinyxml2::XMLElement boneXML,
tinyxml2::XMLElement parentXML 
)
static
var decodeBone ( var  boneXML,
var  parentXML 
)
static
local decodeBone ( local  boneXML,
local  parentXML 
)
static
static BoneData* decodeBone ( cs::JsonDictionary json)
static
var decodeBone ( var  json)
static
local decodeBone ( local  json)
static
static DisplayData*
decodeBoneDisplay
( tinyxml2::XMLElement displayXML)
static
var decodeBoneDisplay ( var  displayXML)
static
local decodeBoneDisplay ( local  displayXML)
static
static DisplayData*
decodeBoneDisplay
( cs::JsonDictionary json)
static
var decodeBoneDisplay ( var  json)
static
local decodeBoneDisplay ( local  json)
static
static ContourData* decodeContour ( tinyxml2::XMLElement contourXML)
static

Decode Contour Datas from xml export from Dragon Bone flash tool.

var decodeContour ( var  contourXML)
static

Decode Contour Datas from xml export from Dragon Bone flash tool.

local decodeContour ( local  contourXML)
static

Decode Contour Datas from xml export from Dragon Bone flash tool.

static ContourData* decodeContour ( cs::JsonDictionary json)
static
var decodeContour ( var  json)
static
local decodeContour ( local  json)
static
static FrameData* decodeFrame ( tinyxml2::XMLElement frameXML,
tinyxml2::XMLElement parentFrameXml,
BoneData boneData 
)
static
var decodeFrame ( var  frameXML,
var  parentFrameXml,
var  boneData 
)
static
local decodeFrame ( local  frameXML,
local  parentFrameXml,
local  boneData 
)
static
static FrameData* decodeFrame ( cs::JsonDictionary json)
static
var decodeFrame ( var  json)
static
local decodeFrame ( local  json)
static
static MovementData* decodeMovement ( tinyxml2::XMLElement movementXML,
ArmatureData armatureData 
)
static
var decodeMovement ( var  movementXML,
var  armatureData 
)
static
local decodeMovement ( local  movementXML,
local  armatureData 
)
static
static MovementData* decodeMovement ( cs::JsonDictionary json)
static
var decodeMovement ( var  json)
static
local decodeMovement ( local  json)
static
static MovementBoneData*
decodeMovementBone
( tinyxml2::XMLElement movBoneXml,
tinyxml2::XMLElement parentXml,
BoneData boneData 
)
static
var decodeMovementBone ( var  movBoneXml,
var  parentXml,
var  boneData 
)
static
local decodeMovementBone ( local  movBoneXml,
local  parentXml,
local  boneData 
)
static
static MovementBoneData*
decodeMovementBone
( cs::JsonDictionary json)
static
var decodeMovementBone ( var  json)
static
local decodeMovementBone ( local  json)
static
static void decodeNode ( BaseData node,
cs::JsonDictionary json 
)
static
var decodeNode ( var  node,
var  json 
)
static
local decodeNode ( local  node,
local  json 
)
static
static TextureData* decodeTexture ( tinyxml2::XMLElement textureXML)
static

Decode Texture Datas from xml export from Dragon Bone flash tool.

var decodeTexture ( var  textureXML)
static

Decode Texture Datas from xml export from Dragon Bone flash tool.

local decodeTexture ( local  textureXML)
static

Decode Texture Datas from xml export from Dragon Bone flash tool.

static TextureData* decodeTexture ( cs::JsonDictionary json)
static
var decodeTexture ( var  json)
static
local decodeTexture ( local  json)
static
static DataReaderHelper*
getInstance
( )
static
var getInstance ( )
static
local getInstance ( )
static
static float getPositionReadScale ( )
static
var getPositionReadScale ( )
static
local getPositionReadScale ( )
static
void loadData ( )
protected
var loadData ( )
protected
local loadData ( )
protected
static void purge ( )
static
var purge ( )
static
local purge ( )
static
static void setPositionReadScale ( float  scale)
static

Scale the position data, used for multiresolution adapter It won't effect the data already read.

var setPositionReadScale ( var  scale)
static

Scale the position data, used for multiresolution adapter It won't effect the data already read.

local setPositionReadScale ( local  scale)
static

Scale the position data, used for multiresolution adapter It won't effect the data already read.

static CC_DEPRECATED_ATTRIBUTE
DataReaderHelper*
sharedDataReaderHelper
( )
inlinestatic
var sharedDataReaderHelper ( )
inlinestatic
local sharedDataReaderHelper ( )
inlinestatic

Member Data Documentation

std::mutex _addDataMutex
protected
var _addDataMutex
protected
local _addDataMutex
protected
unsigned long _asyncRefCount
protected
var _asyncRefCount
protected
local _asyncRefCount
protected
unsigned long _asyncRefTotalCount
protected
var _asyncRefTotalCount
protected
local _asyncRefTotalCount
protected
std::queue<AsyncStruct *>
* _asyncStructQueue
protected
var _asyncStructQueue
protected
local _asyncStructQueue
protected
std::mutex _asyncStructQueueMutex
protected
var _asyncStructQueueMutex
protected
local _asyncStructQueueMutex
protected
std::mutex _dataInfoMutex
protected
var _dataInfoMutex
protected
local _dataInfoMutex
protected
std::queue<DataInfo *>* _dataQueue
protected
var _dataQueue
protected
local _dataQueue
protected
DataReaderHelper* _dataReaderHelper
staticprotected
var _dataReaderHelper
staticprotected
local _dataReaderHelper
staticprotected
std::thread* _loadingThread
protected
var _loadingThread
protected
local _loadingThread
protected
std::condition_variable
_sleepCondition
protected
var _sleepCondition
protected
local _sleepCondition
protected
std::mutex _sleepMutex
protected
var _sleepMutex
protected
local _sleepMutex
protected
bool need_quit
protected
var need_quit
protected
local need_quit
protected

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