My Project
Public Member Functions | Public Attributes | List of all members
NPLInterface::NPLFileNameT< StringType > Struct Template Reference

a globally unique name of a NPL file name instance. More...

#include <NPLMiniRuntime.hpp>

Public Member Functions

 NPLFileNameT (const char *filename)
 create the NPL file name object from a string. More...
 
void SetRelativePath (const char *sPath, int nCount=-1)
 set the relaive_Path More...
 
std::string ToString ()
 convert to string of the following format [(sRuntimeStateName|gl)][sNID:]sRelativePath[]
 
void ToString (std::string &output)
 
void FromString (const char *sFilePath)
 reset from string More...
 

Public Attributes

StringType sRuntimeStateName
 the runtime state name that the file belongs to. More...
 
StringType sNID
 the NPL runtime server ID that the file belongs to. More...
 
StringType sRelativePath
 the relative file path of the NPL file in the Runtime's file system. More...
 
StringType sDNSServerName
 the DNS file name. More...
 

Detailed Description

template<class StringType = std::string>
struct NPLInterface::NPLFileNameT< StringType >

a globally unique name of a NPL file name instance.

The string format of an NPL file name is like below. [(sRuntimeStateName|gl)][sNID:]sRelativePath[]

Constructor & Destructor Documentation

§ NPLFileNameT()

template<class StringType = std::string>
NPLInterface::NPLFileNameT< StringType >::NPLFileNameT ( const char *  filename)
inline

create the NPL file name object from a string.

The string is of the following file format

Parameters
filename[(sRuntimeStateName|gl)][sNID:]sRelativePath[] the following is a list of all valid file name combinations: "user001@paraengine.com:script/hello.lua" – a file of user001 in its default gaming thread "(world1)server001@paraengine.com:script/hello.lua" – a file of server001 in its thread world1 "(worker1)script/hello.lua" – a local file in the thread worker1 "(gl)script/hello.lua" – a glia (local) file in the current runtime state's thread "script/hello.lua" – a file in the current thread. For a single threaded application, this is usually enough.

Member Function Documentation

§ FromString()

template<class StringType = std::string>
void NPLInterface::NPLFileNameT< StringType >::FromString ( const char *  sFilePath)
inline

reset from string

See also
NPLFileName() for details.

get the activation type

get namespace

get relative path

get relative path

get DNS server name

§ SetRelativePath()

template<class StringType = std::string>
void NPLInterface::NPLFileNameT< StringType >::SetRelativePath ( const char *  sPath,
int  nCount = -1 
)
inline

set the relaive_Path

Parameters
sPathwhere the path string is.
nCountthe number of characters to copy from sPath. If this is negative. the whole sPath will be read.

Member Data Documentation

§ sDNSServerName

template<class StringType = std::string>
StringType NPLInterface::NPLFileNameT< StringType >::sDNSServerName

the DNS file name.

this is a global server where the sNID can be authenticated and converted to IP/port. if empty, it first defaults to the server part of sNID, if that is empty too, default to the current one in the local runtime environment. we rarely need to explicitly specify DNS server.

§ sNID

template<class StringType = std::string>
StringType NPLInterface::NPLFileNameT< StringType >::sNID

the NPL runtime server ID that the file belongs to.

It usually represents a network endpoint (IP/port). However, instead of using IP address "192.168.0.111/60001", we usually use email like addresses, like "1001@paraengine.com" the email address will latter be resolved to IP/port. if empty, it means the local runtime environment. Specially, "all@local" means all remote NIDs connecting to this local machine.

§ sRelativePath

template<class StringType = std::string>
StringType NPLInterface::NPLFileNameT< StringType >::sRelativePath

the relative file path of the NPL file in the Runtime's file system.

it uses forward slashes such as "script/sample.lua" if empty, it defaults to "script/empty.lua"

§ sRuntimeStateName

template<class StringType = std::string>
StringType NPLInterface::NPLFileNameT< StringType >::sRuntimeStateName

the runtime state name that the file belongs to.

It usually specifies which thread the file instance is running in. If empty or "gl", it means the current or default runtime state. It must be a string with only alphabetic letters.


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