Inheritance, Classes, Object and class name syntax – BrightSign HD2000 Object Reference Manual User Manual

Page 5: Types

Advertising
background image

interface would contain only the new methods. The “old” method still exists in the original Interface.
Older applications will only use the original interface, but newer applications could use the original and the
new interface. This ensures full backwards compatibility with the installed base of Roku scripts and
applications with future versions of Roku products.

Roku Objects consist only of interfaces. Interfaces define only methods. There is no concept of a
“property” or variable at the Object or Interface level. These must be implemented as Set/Get methods in
an Interface.

Inheritance

There is no explicit support for Inheritance in the RO architecture. However, this section is a brief
discussion of how C++ concepts of inheritance map to ROs.

Use of Virtual Base classes to abstract interfaces. For example, in C++ one might create a

virtual base class for a AsciiStream Object. Then create implementation class for an RS232Port,
TCP, or Keyboard. This type of functionality is accomplished with Roku Objects by defining an
Interface (for example ifAsciiStream), then ROs that expose this interface (e.g. the roTCP)

Use of “Mix-in” classes to bring-in existing functionality. ROs don’t have an exact equivalent.

If the writer of an object wants to bring-in existing RO they can create them and hold a reference
to them internally. If the object creator wants to expose a created objects Interface(s), it must
expose the same interface (all interfaces are public), and then when an interface method is called,
the RO calls the appropriate Interface of a called object.

Classes

A Class Name is the name used to create a Roku Object. For example:
video= CreateObject("roVideoPlayer")

roVideoPlayer is the class name.

Object and Class Name Syntax

Class names:

 must start with an alphabetic character (a – z)

 may consist of alphabetic characters, numbers, or the symbol “_” (underscore)

 they are not case sensitive

 may be of any reasonable length

Types

The following types are currently defined for values that can be passed to or returned from a RO Method:

 "rotVOID"

 "rotINT32"

 "rotFLOAT"

 "rotSTRING"

 "rotBOOL"

 "rotOBJECT”

 “rotINTERFACE”


Note that:

 Types are strings.

 The class name of an object is the type of that object.

5

Advertising
This manual is related to the following products: