首页 / base / oaNameSpace

oaNameSpace

模块: oapy._oa._base 导入: from oapy._oa import _base

概览

oaNameSpaceoapy 中可用,可通过 _base 模块访问。

本页汇总 oaNameSpace 当前在 oapy 中可用的 Python 接口。

详细说明

A name space refers to a set of rules for creating and interpreting legal names within an application。 The oaNameSpace utility class is an abstract base class for defining the name spaces used in name mapping。 In conjunction with the oaName object, derived oaNameSpace classes facilitate mapping names to and from the internal representation of a name。 See the Name Mapping Section of the Programmer's Guide for more information about mapping names between different namespaces。 Functions for oaNameSpace are not used by the normal application code。 The functions are only used by the developers creating their own name space。 To create your own name space, create a class derived from oaNameSpace and implement the virtual functions in oaNameSpace that require non-default behavior for your own name space。 These functions have default implementations on the oaNameSpace class itself, and the defaults described here are appropriate for some name spaces。 All namespaces apply to external representations of names。 Names have an internal representation that is not simply a string。 This internal format uses the oaNative name space for portions of the name。 Thus, when implementing a new derived name space, you need to determine how to translate names from your original language to the desired output names in the oaNative name space, and vice versa。 Since any name handed to a name space is in internal format, the derived name space just needs to provide a translation from oaNative to their name space, and from their name space to oaNative。 Once this is implemented, names in the new derived name space can be mapped to any other derived name space。 When a name space receives a name from the database, the name is stored in a tighly packed byte array for efficiency。 The oaNameSpace class provides utility functions such as readUInt4() and readStr() to help interpret this byte array。 A derived name space must implement the get() function which reads in the byte array and maps it to an output string in the derived name space。 See Deriving Your Own Namespace Section of the Programmer's Guide for more information。

方法总览

状态 Python 调用
obj.isEqual(n1, n2)
obj.isEqual(n1, n2)
obj.isEqual(n1, n2)
obj.isEqual(n1, n2)
obj.isEqual(n1, n2)
obj.isEqual(n1, n2)
obj.isEqual(n1, n2)
obj.getType(in)
obj.getInternalMember(in, out, caseSensitive, len, flags=0)
obj.getInternalScalar(in, out)
obj.getInternalVBit(in, out, baseOnly=false)
obj.getInternalVector(in, out, baseOnly=false)
obj.getInternalBundle(in, out)
obj.getMember(in, caseSensitive, out, loc, flags=0)
obj.getMemberArray(in, numMembers, out, loc)
obj.getScalarName(in, out, loc)
obj.getVectorName(in, out, loc)
obj.getVectorBitName(in, out, loc)
obj.getVectorBitName(in, numMembers, start, out, loc)
obj.getBundleName(in, out, loc)
obj.getSimpleName(in, out, loc)
obj.get(data, out, loc)

方法说明

obj.isEqual(n1, n2)

绑定状态: 已绑定

Python 调用: obj.isEqual(n1, n2)

This function returns a boolean value that indicates if the specified vector name and vectorbit name are equal in this name space。 Since this function is both overloaded and virtual, derived name spaces need to implement all of the isEqual functions。 A default implementation is provided to make this easier。 由 oaLefNS 和 oaDefNS 实现。

参数

  • n1: The first name to check。
  • n2: The second name to check。

异常

  • oacIndexedNameInvalid

Python 示例

from oapy._oa import _base

# assume obj is a oaNameSpace
obj.isEqual(n1, n2)

obj.isEqual(n1, n2)

绑定状态: 已绑定

Python 调用: obj.isEqual(n1, n2)

This function returns a boolean value that indicates if the two specified name members are equal in this name space。 Since this function is both overloaded and virtual, derived name spaces needs to implement all of the isEqual functions。 Note: This is a pure virtual function, defined but not implemented in oaNameSpace。 Classes derived from oaNameSpace must define this function in order to be instantiated。

参数

  • n1: The first name to check。
  • n2: The second name to check。

Python 示例

from oapy._oa import _base

# assume obj is a oaNameSpace
obj.isEqual(n1, n2)

obj.isEqual(n1, n2)

绑定状态: 已绑定

Python 调用: obj.isEqual(n1, n2)

This function returns a boolean value that indicates if the two specified names are equal in this name space。 Since this function is both overloaded and virtual, derived name spaces need to implement all of the isEqual functions。 A default implementation is provided to make this easier。 由 oaNativeNS 实现。

参数

  • n1: The first name to check。
  • n2: The second name to check。

Python 示例

from oapy._oa import _base

# assume obj is a oaNameSpace
obj.isEqual(n1, n2)

obj.isEqual(n1, n2)

绑定状态: 已绑定

Python 调用: obj.isEqual(n1, n2)

This function returns a boolean value that indicates if the two specified simple names are equal in this name space。 Since this function is both overloaded and virtual, derived name spaces need to implement all of the isEqual functions。 A default implementation is provided to make this easier。 由 oaNativeNS 实现。

参数

  • n1: The first name to check。
  • n2: The second name to check。

Python 示例

from oapy._oa import _base

# assume obj is a oaNameSpace
obj.isEqual(n1, n2)

obj.isEqual(n1, n2)

绑定状态: 已绑定

Python 调用: obj.isEqual(n1, n2)

This function returns a boolean value that indicates if the two specified bundle names are equal in this name space。 Since this function is both overloaded and virtual, derived name spaces need to implement all of the isEqual functions。 A default implementation is provided to make this easier。 由 oaNativeNS 实现。

参数

  • n1: The first name to check。
  • n2: The second name to check。

异常

  • oacBundleNameInvalid

Python 示例

from oapy._oa import _base

# assume obj is a oaNameSpace
obj.isEqual(n1, n2)

obj.isEqual(n1, n2)

绑定状态: 已绑定

Python 调用: obj.isEqual(n1, n2)

This function returns a boolean value that indicates if the two specified vector bit names are equal in this name space。 Since this function is both overloaded and virtual, derived name spaces need to implement all of the isEqual functions。 A default implementation is provided to make this easier。 由 oaNativeNS 实现。

参数

  • n1: The first name to check。
  • n2: The second name to check。

异常

  • oacIndexedNameInvalid

Python 示例

from oapy._oa import _base

# assume obj is a oaNameSpace
obj.isEqual(n1, n2)

obj.isEqual(n1, n2)

绑定状态: 已绑定

Python 调用: obj.isEqual(n1, n2)

This function returns a boolean value that indicates if the two specified vector names are equal in this name space。 Since this function is both overloaded and virtual, derived name spaces need to implement all of the isEqual functions。 A default implementation is provided to make this easier。 由 oaNativeNS 实现。

参数

  • n1: The first name to check。
  • n2: The second name to check。

异常

  • oacVectorNameInvalid

Python 示例

from oapy._oa import _base

# assume obj is a oaNameSpace
obj.isEqual(n1, n2)

obj.getType(in)

绑定状态: 已绑定

Python 调用: obj.getType(in)

This function returns the type of name represented by the specified string this name space: scalar, vector bit, vector, or bundle。 This function does not indicate if the name is valid。 Note: This is a pure virtual function, defined but not implemented in oaNameSpace。 Classes derived from oaNameSpace must define this function in order to be instantiated。 由 oaNativeNS 实现。

参数

  • in: The input string。

返回

  • The type of name in represents in this name space。

Python 示例

from oapy._oa import _base

# assume obj is a oaNameSpace
obj.getType(in)

obj.getInternalMember(in, out, caseSensitive, len, flags=0)

绑定状态: 已绑定

Python 调用: obj.getInternalMember(in, out, caseSensitive, len, flags=0)

This function returns in out, the input string mapped into the internal name space。 The len characters of the input string are evaluated。 The default is to evaluate the entire string。 Note: This is a pure virtual function, defined but not implemented in oaNameSpace。 Classes derived from oaNameSpace must define this function in order to be instantiated。

参数

  • in: The input string representing a name member in this name space。
  • out: The output name member object created from mapping input string into the native name space。
  • caseSensitive: Determines if the string is case sensitive。
  • len: The number of characters of in to evaluate。
  • flags: Has no valid values other than 0 in this name space。

Python 示例

from oapy._oa import _base

# assume obj is a oaNameSpace
obj.getInternalMember(in, out, caseSensitive, len, flags=0)

obj.getInternalScalar(in, out)

绑定状态: 已绑定

Python 调用: obj.getInternalScalar(in, out)

This function returns in out, the input string mapped into the internal name space。 Note: This is a pure virtual function, defined but not implemented in oaNameSpace。 Classes derived from oaNameSpace must define this function in order to be instantiated。

参数

  • in: The input string representing a scalar name in this name space。
  • out: The output scalar name object created from mapping input string into the native name space。

Python 示例

from oapy._oa import _base

# assume obj is a oaNameSpace
obj.getInternalScalar(in, out)

obj.getInternalVBit(in, out, baseOnly=false)

绑定状态: 已绑定

Python 调用: obj.getInternalVBit(in, out, baseOnly=false)

This function returns in out, the input string mapped into the internal name space。 If the value of baseOnly is false, the string is interpreted as an entire vector bit name。 If the value is true, in is interpreted as the base of the vector bit name。 Derived name spaces that support indexed names should reimplement this function。

参数

  • in: The input string representing a vector base name in this name space。
  • out: The output vector bit name object created from mapping input string into the native name space。
  • baseOnly: Determines if the input string is an entire vectorbit name or just the base value。

异常

  • oacIndexedNameInvalid

Python 示例

from oapy._oa import _base

# assume obj is a oaNameSpace
obj.getInternalVBit(in, out, baseOnly=false)

obj.getInternalVector(in, out, baseOnly=false)

绑定状态: 已绑定

Python 调用: obj.getInternalVector(in, out, baseOnly=false)

This function returns in out, the input string mapped into the internal name space。 If the value of baseOnly is false, the string is interpreted as an entire vector name。 If the value is true, in is interpreted as the base of the vector bit name。 Derived name spaces that support vector names should reimplement this function。 在 oaLefNS 和 oaDefNS 中重新实现。

参数

  • in: The input string representing a vector name in this name space。
  • out: The output vector name object created from mapping input string into the native name space。
  • baseOnly: Determines if the input string is an entire vector name or just the base value。

异常

  • oacVectorNameInvalid

Python 示例

from oapy._oa import _base

# assume obj is a oaNameSpace
obj.getInternalVector(in, out, baseOnly=false)

obj.getInternalBundle(in, out)

绑定状态: 已绑定

Python 调用: obj.getInternalBundle(in, out)

This function returns in out, the input string mapped into the internal name space。 Derived name spaces that support bundle names should reimplement this function。

参数

  • in: The input string representing a bundle name in this name space。
  • out: The output bundle name object created from mapping input string into the native name space。

异常

  • oacBundleNameInvalid

Python 示例

from oapy._oa import _base

# assume obj is a oaNameSpace
obj.getInternalBundle(in, out)

obj.getMember(in, caseSensitive, out, loc, flags=0)

绑定状态: 已绑定

Python 调用: obj.getMember(in, caseSensitive, out, loc, flags=0)

This function returns in the string out, at the location loc, the input name member in with case sensitivity value caseSensitive mapped into this name space。 It is assumed that the input name is in the native name space format。 Note: This is a pure virtual function, defined but not implemented in oaNameSpace。 Classes derived from oaNameSpace must define this function in order to be instantiated。

参数

  • in: The input name member in the native name space format。
  • caseSensitive: The case sensitivity value of the input name member。
  • out: The string value of the input name in this name space。
  • loc: The location in out at which the function starts writing。
  • flags: Has no valid values other than 0 in this name space。

Python 示例

from oapy._oa import _base

# assume obj is a oaNameSpace
obj.getMember(in, caseSensitive, out, loc, flags=0)

obj.getMemberArray(in, numMembers, out, loc)

绑定状态: 已绑定

Python 调用: obj.getMemberArray(in, numMembers, out, loc)

This function returns in the string out, at the location loc, the input name member array in, mapped into this name space。 It is assumed the array has numMembers elements and the input name is in the internal name space format。 Derived name spaces that support hierarchical names should reimplement this function。

参数

  • in: The input name member array。
  • numMembers: The number of members in the input array。
  • out: The string value of the input array in this name space。
  • loc: The location in out at which the function starts writing。

异常

  • oacHierNameInvalid

Python 示例

from oapy._oa import _base

# assume obj is a oaNameSpace
obj.getMemberArray(in, numMembers, out, loc)

obj.getScalarName(in, out, loc)

绑定状态: 已绑定

Python 调用: obj.getScalarName(in, out, loc)

This function returns in the string out, at the location loc, the input scalar name in mapped into this name space。 It is assumed the input name is in the internal namespace format。 Note: This is a pure virtual function, defined but not implemented in oaNameSpace。 Classes derived from oaNameSpace must define this function in order to be instantiated。

参数

  • in: The input scalar name。
  • out: The string value of the scalar name in this name space。
  • loc: The location in out at which the function starts writing。

Python 示例

from oapy._oa import _base

# assume obj is a oaNameSpace
obj.getScalarName(in, out, loc)

obj.getVectorName(in, out, loc)

绑定状态: 已绑定

Python 调用: obj.getVectorName(in, out, loc)

This function returns in the string out, at the location loc, the input vector name in mapped into this name space。 It is assumed the input name is in the native name space format。 Derived name spaces that support vector names should reimplement this function。 在 oaLefNS 和 oaDefNS 中重新实现。

参数

  • in: The input vector name。
  • out: The string value of the vector name in this name space。
  • loc: The location in out at which the function starts writing。

异常

  • oacVectorNameInvalid

Python 示例

from oapy._oa import _base

# assume obj is a oaNameSpace
obj.getVectorName(in, out, loc)

obj.getVectorBitName(in, out, loc)

绑定状态: 已绑定

Python 调用: obj.getVectorBitName(in, out, loc)

This function returns in the string out, at the location loc, the input vector bit name in mapped into this name space。 It is assumed the array has numMembers elements and is in the internal namespace format。 Derived name spaces that support indexed names should reimplement this function。

参数

  • in: The input vector bit name。
  • numMembers: The number of members in the input array。
  • start:
  • out: The string value of the vector bit name in this name space。
  • loc: The location in out at which the function starts writing。

异常

  • oacIndexedNameInvalid

Python 示例

from oapy._oa import _base

# assume obj is a oaNameSpace
obj.getVectorBitName(in, out, loc)

obj.getVectorBitName(in, numMembers, start, out, loc)

绑定状态: 已绑定

Python 调用: obj.getVectorBitName(in, numMembers, start, out, loc)

This function returns in the string out, at the location loc, the input vector bit name in mapped into this name space。 It is assumed the input name is in the internal namespace format。 Derived name spaces that support indexed names should reimplement this function。

参数

  • in: The input vector bit name。
  • out: The string value of the vector bit name in this name space。
  • loc: The location in out at which the function starts writing。

异常

  • oacIndexedNameInvalid

Python 示例

from oapy._oa import _base

# assume obj is a oaNameSpace
obj.getVectorBitName(in, numMembers, start, out, loc)

obj.getBundleName(in, out, loc)

绑定状态: 已绑定

Python 调用: obj.getBundleName(in, out, loc)

This function returns in the string out, beginning at the location loc, the input bundle name in mapped into this name space。 It is assumed the input name is in the native name space format。 Derived name spaces that support bundle names should reimplement this function。

参数

  • in: The input bundle name in the native name space format。
  • out: The string value of the input name in this name space。
  • loc: The location in out at which the function starts writing。

异常

  • oacBundleNameInvalid

Python 示例

from oapy._oa import _base

# assume obj is a oaNameSpace
obj.getBundleName(in, out, loc)

obj.getSimpleName(in, out, loc)

绑定状态: 已绑定

Python 调用: obj.getSimpleName(in, out, loc)

This function returns in the string out, at the location loc, the input simpleName in mapped into this name space。 It is assumed the input name is in the internal namespace format。 The default implementation calls the correct 'get' function for the type of name the simple name represents: scalar, vector bit, or vector。

参数

  • in: The input simple name。
  • out: The string value of the simple name in this name space。
  • loc: The location in out at which the function starts writing。

Python 示例

from oapy._oa import _base

# assume obj is a oaNameSpace
obj.getSimpleName(in, out, loc)

obj.get(data, out, loc)

绑定状态: 已绑定

Python 调用: obj.get(data, out, loc)

This function returns in the string out, beginning at the location loc, the input data block data mapped into this name space。 For efficiency, when the database hands a name to the name space, the name is packed into a byte array with a predefined format。 This avoids the overhead of allocating a name object in order to map the name to the destination name space。 The get() function in the derived name space translates this byte array into a string mapped in the destination name space。 More information on the format for the data byte array is available in the Programmers Guide topic, 'Deriving Your Own NameSpace'。 Note: This is a pure virtual function, defined but not implemented in oaNameSpace。 Classes derived from oaNameSpace must define this function in order to be instantiated。

参数

  • data: The block of data representing a name in the native name space format。
  • out: The value of the input name data in this name space。
  • loc: The location in out at which the function starts writing。

Python 示例

from oapy._oa import _base

# assume obj is a oaNameSpace
obj.get(data, out, loc)