Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As will be appreciated by one skilled in the art, embodiments of the present invention may be embodied as a system, apparatus, device, method, or computer program product. Accordingly, the present disclosure may be embodied in the form of: entirely hardware, entirely software (including firmware, resident software, micro-code, etc.), or a combination of hardware and software.
The key terms mentioned in the present invention are defined as follows:
Objective-C language: the main development language of iOS native APP, which is extended by C language and Smalltalk, is a superset of C language, and the biggest difference is that OC is object-oriented. The ecology of the mobile internet has brought about the rise of Objective-C language.
The Objective-C language is a dynamic language that puts much of the static language done during compile and link time into runtime for processing. For Objective-C, the runtime system behaves like an operating system: it allows all work to run normally. Runtime is basically written in C language and assembly language, so that C language has object-oriented capability. In Runtime, objects can be represented by structures in C language, and methods can be implemented by C functions, plus some additional features. After the structures and functions are packaged by runtime functions, object-oriented programming of the OC becomes possible.
Storyboard: the integrated functions in the IDE tool Xcode are visual interface editing tools, and the bottom layer uses XML description.
Primary production: the method utilizes iOS to develop related development language, development class library and development tool to develop App.
The dynamic property: the dynamic property refers to the property of being capable of being dynamically executed through background delivery, the property can reduce the labor cost and the time cost of a terminal release version, a user can also quickly acquire the latest version of service, and the dynamic property is an important property in the era of mobile internet.
block: block is a C language extension function introduced only by iOS 4. block is an anonymous function with an automatic variable (i.e., a local variable) value, which as its name implies is an unnamed function with an automatic variable (i.e., a local variable) value. blocks are widely used in iOS development.
In view of the fact that the application dynamics and rendering performance cannot be balanced, the development efficiency of the application and the user experience of the application cannot be balanced, and hardware calling limitations exist in the prior art, embodiments of the present invention provide an iOS application-based interface rendering method, where a configuration file of a specific rule is used to analyze the content of the configuration file during the running of an application program, and the running characteristics of the iOS development are used to interpret and render a page corresponding to the configuration file, thereby providing efficient page rendering. The configuration file adopts a JSON data format which is a lightweight data exchange text format completely independent of languages, and the characteristics make JSON become an ideal data exchange language, so that the JSON is easy to read and write by people and is easy to analyze and generate by a machine. By combining the characteristics of easy writing of JSON data format and the runtime characteristics of iOS native development, the following technical problems can be solved:
1. and the requirement of application dynamics is met. Using the configuration file as the description of the application page, and presenting the complete application page by matching the explanation of the configuration file with the corresponding page rendering rule; the dynamic update of the application content is realized through the dynamic update of the configuration file so as to meet the requirement of the application program on the dynamic property.
2. And the page rendering performance is improved. By utilizing the iOS running characteristic, the rendering of the page is actually realized by the rendering framework of the iOS system, and the rendering performance is effectively guaranteed.
3. And (4) coding and multiplexing. The configuration file which can be transplanted and modified has a uniform rendering result under a uniform interpretation method, and the configuration file can be repeatedly used, so that repeated coding is avoided.
4. Native hardware call restrictions are avoided based on iOS native. The iOS native development can directly call the hardware equipment which the system allows to access, and acquire the related input data.
5. The development threshold is lowered, and a user can obtain the required app only through the configuration file without knowing the development of the OC language and the iOS.
The invention introduces the configuration file, can obtain a complete application program through the analysis and the rendering of the rendering engine without writing any native development code, and the invention is explained in detail by combining the attached drawings.
Fig. 1 is a flowchart of an iOS application-based interface rendering method in an embodiment of the present invention. Fig. 2 is a flowchart of an iOS application based interface rendering method according to another embodiment of the present invention. As shown in fig. 1 and 2, the interface rendering method based on the iOS application includes:
s101: and responding to the page creation requirement to obtain a corresponding root view stack bottom page example, and analyzing a page sub-view corresponding to the root view stack bottom page example to generate a virtual tree.
In specific implementation, an application page defined in a configuration file may be registered first, then a corresponding root view stack bottom page instance is obtained from the block in response to a page creation requirement, and a virtual tree is generated by analyzing a page sub-view corresponding to the root view stack bottom page instance according to the configuration file.
And generating a page example at the bottom of the root view stack through the root view configuration file. The root view is a Controller at the bottom layer of the application view, and can be a Navigation Controller (Navigation Controller) or a tab Controller (tab Controller). The controller is of a stack structure and provides a method for popping and pushing a stack for loading and disappearing of a new page.
Fig. 3 is a flowchart of an iOS application based interface rendering method according to still another embodiment of the present invention. As shown in fig. 3, the setting of the configuration file includes:
1. a configuration file for the application is generated using a configuration file editor writing or other tool according to established rules. The configuration files comprise a global general configuration file, a root view file, a page registration file, each page file and the like. The configuration file editor can be selected by a developer according to the development habit of the developer, or a self-defined configuration file editor is developed to improve the writing efficiency of the configuration file.
2. The application loads the configuration file. The application is started and the configuration file is obtained locally from the server or the application. When the configuration file is loaded, a specified loading mode needs to be set so that the engine can confirm the source of the configuration file, and a reasonable loading strategy can also be set so as to ensure the completeness of the loading logic of the application program.
The configuration file can be selected as a resource file to be built in the application program by combining with the actual development condition, or the page can be modified in an active import mode. Dynamic update can be realized only by matching the configuration files meeting the rules with certain update logic.
3. Analyzing and checking the configuration file, wherein the checking content comprises the following steps:
1) integrity check requires that the application must have the configuration file to be complete.
2) And (4) validity check, correctness of json data format of the configuration file, no field missing and the like.
3) And checking the version, namely detecting the version information of the configuration file and confirming the version information as an available version.
FIG. 6 is a flowchart illustrating an example of generating a root view stack bottom page according to an embodiment of the present invention. As shown in fig. 6, generating an instance of the stack bottom page of the root view includes:
s401: registering a class corresponding to the IOS application program, and adding method definition and attribute definition to the class.
In specific implementation, the configuration file may be read to register classes corresponding to the IOS application program, and the classes are stored in the device memory: and by utilizing the iOS Runtime characteristic, dynamically registering the class defined in the configuration file by using Runtime, and adding corresponding method definition and attribute definition to the class.
S402: and generating page data according to the classes subjected to the method addition and the attribute addition.
S403: and generating a stack bottom page example of the root view according to the configuration file and the page data.
After acquiring the corresponding root view stack bottom page instance, the method further comprises the following steps: reading an attribute value corresponding to the attribute definition of the page instance at the bottom of the stack of the root view from the configuration file; and assigning the attribute definition of the page example at the bottom of the stack of the root view according to the attribute value, wherein the assignment content can comprise page background color, navigation bar state, navigation bar title, entry animation and the like.
S102: and mapping the virtual tree onto the view component to create a sub-view instance, and generating the view instance according to the sub-view instance and the page instance at the bottom of the root view stack.
The view component comprises an iOS system component or a self-defined component, the system component comprises UIView, UILabel, UIButton, UIImageView and the like, and the view instance is generated according to the sub-view instance and the root view stack bottom page instance by utilizing an iOS runtime mechanism.
S103: and searching a corresponding method from the configuration file according to the method definition of the page example at the bottom of the stack of the root view.
S104: binding a method responder corresponding to the method realization with the method realization, and writing the bound method realization into the method definition.
After a method responder corresponding to the method realization is bound with the method realization, a method can be called to process a page jump method through a message sending mechanism in the iOS runtime, and any method clearly defining a receiver and the method realization can be processed.
After binding the method responder corresponding to the method implementation with the method implementation, the layout information of the view can be set through the following procedures:
searching layout information data of the corresponding component in the configuration file, and determining a dependent component corresponding to the view component from the layout information data; and traversing all the dependency constraint information of the dependency component, determining the constraint relation in the dependency constraint information according to the view component and the dependency component, and writing the constraint relation into the view component. The constraint relationships include the location of the top, bottom, left, right center points relative to the dependent component, as well as the aspect ratio of the dependent component itself or relative to the dependent component.
The execution subject of the iOS application-based interface rendering method shown in fig. 1 may be an application program. As can be seen from the process shown in fig. 1, the interface rendering method based on the iOS application according to the embodiment of the present invention first responds to a page creation requirement to obtain a corresponding root view stack bottom page instance to generate a virtual tree, then maps the virtual tree onto a view component to create a sub-view instance, generates a view instance according to the sub-view instance and the root view stack bottom page instance, and then searches for a corresponding method implementation from a configuration file according to a method definition of the root view stack bottom page instance to bind a corresponding method responder to the method implementation and then writes the method implementation into the method definition, which can meet the requirement of application dynamics, improve page rendering performance, improve development efficiency, and avoid hardware call limitation.
FIG. 4 is a flow diagram of the create view component in an embodiment of the invention. As shown in fig. 4, after S104 is executed, the method for rendering an interface based on an iOS application further includes:
s201: registering the page data model class, generating a data request according to the instance corresponding to the page data model class, and sending the data request to the corresponding interface address.
In specific implementation, an interface (API) address corresponding to the page data model class may be read from the configuration file, a corresponding data model portion may be found from the configuration file, an attribute in the data model is added to a corresponding registered class to register the data model class, and the data model class is stored in the memory.
S202: and analyzing the data returned by the interface address, and writing an analysis result into the view component.
FIG. 5 is a flow diagram of writing the parsed result to the view component in an embodiment of the present invention. As shown in FIG. 5, writing the parsed result to the view component includes:
s301: and writing the analysis result into the attribute of the instance corresponding to the page data model class.
S302: and binding the attribute written in the analysis result with the view component according to the binding relation file.
In an embodiment, the binding relationship file may be obtained from the configuration file, and the attribute written in the analysis result and the attribute in the view component are subjected to data binding according to the binding relationship file.
S303: and writing the attribute written into the analysis result into the attribute of the view component.
The page data also needs to be refreshed after S303 is performed.
The specific process of the embodiment of the invention is as follows:
1. registering a class corresponding to the IOS application program, and adding method definition and attribute definition to the class.
2. And generating page data according to the classes subjected to the method addition and the attribute addition.
3. And generating a stack bottom page example of the root view according to the configuration file and the page data.
4. And reading an attribute value corresponding to the attribute definition of the root view stack bottom page instance from the configuration file, and assigning the attribute definition of the root view stack bottom page instance according to the attribute value.
5. And responding to the page creation requirement to obtain a corresponding root view stack bottom page example, and analyzing a page sub-view corresponding to the root view stack bottom page example to generate a virtual tree.
6. And mapping the virtual tree onto the view component to create a sub-view instance, and generating the view instance according to the sub-view instance and the page instance at the bottom of the root view stack.
7. And searching a corresponding method from the configuration file according to the method definition of the page example at the bottom of the stack of the root view.
8. Binding a method responder corresponding to the method realization with the method realization, and writing the bound method realization into the method definition.
9. Determining a dependency component corresponding to the view component, determining a constraint relation according to the view component and the dependency component, and writing the constraint relation into the view component.
10. Registering the page data model class, generating a data request according to the instance corresponding to the page data model class, and sending the data request to the corresponding interface address.
11. And analyzing the data returned by the interface address, and writing an analysis result into the attribute of the instance corresponding to the page data model class.
12. And binding the attribute written in the analysis result with the view component according to the binding relation file.
13. And writing the attribute written into the analysis result into the view component.
In summary, the interface rendering method based on the iOS application provided by the embodiment of the present invention has the following beneficial effects:
(1) and the application development threshold is reduced, and the application development efficiency is improved. The JSON data is used as a data format of the configuration file, and the development difficulty of developers is effectively reduced by utilizing the characteristics of easy writing and easy reading of the JSON data. After the writing rules of the configuration file are familiar, non-developers can also write pages by editing the configuration file.
(2) The dynamic performance is guaranteed and the page rendering performance is improved. The application configuration file can be updated in a mode of issuing the configuration file by the server, the updated configuration file is interpreted, and an iOS system rendering framework is called to render the page. Prior art solutions sacrifice some system performance by using a browser to load the H5 page or implementing custom rendering policies. The invention utilizes the iOS running characteristic when rendering the page, and completely uses the system characteristic to call the rendering framework of the system, thereby not only ensuring the dynamic update of the application program, but also solving the problem of performance loss of the prior art. (ii) a
(3) The code reusability is improved, and the development cost is reduced. The configuration file with complete system corresponds to a complete application program, and the configuration file with complete rule corresponds to a complete page, so that the reusability of the page only depends on the rendering engine described by the invention, and the page can be reused by only introducing the configuration file of the rendering engine. By continuously improving and updating the configuration file, the invention can develop the basis and the high-level components of a whole set of application program as the strong productivity of the writing of the application program;
(4) the conventional rendering engine only performs page rendering through a rendering tree, and native logic codes are additionally added for push-push logic between pages and complex processing logic of a page stack, but the invention can process jump logic between pages.
The data of the existing rendering engine can only be predefined fixed data, but the invention can request the latest data through a dynamic interface and perform modeling conversion and binding and filling of view data, and can also interact with the events of the user through dynamic processing. A user can complete the function development of the complete APP only by importing or issuing the configuration file without compiling codes.
Based on the same inventive concept, the embodiment of the invention also provides an interface rendering device based on the iOS application, and as the principle of solving the problem of the device is similar to the interface rendering method based on the iOS application, the implementation of the device can refer to the implementation of the method, and repeated parts are not described again.
Fig. 7 is a schematic diagram of an iOS application-based interface rendering apparatus according to an embodiment of the present invention. Fig. 8 is a block diagram illustrating an interface rendering apparatus based on an iOS application according to another embodiment of the present invention. FIG. 9 is a functional flow diagram of the modules in FIG. 8. As shown in fig. 7 to 9, the iOS application-based interface rendering apparatus includes:
the virtual tree generation module is used for responding to page creation requirements to obtain a corresponding root view stack bottom page example and analyzing a page sub-view corresponding to the root view stack bottom page example to generate a virtual tree;
the view instance generating module is used for mapping the virtual tree to the view component to create a sub-view instance and generating the view instance according to the sub-view instance and the page instance at the bottom of the root view stack;
the method implementation module is used for searching the corresponding method implementation from the configuration file according to the method definition of the root view stack bottom page example;
and the binding and writing module is used for binding a method responder corresponding to the method realization with the method realization and writing the bound method realization into the method definition.
As shown in fig. 8 to 9, in practical applications, the iOS application-based interface rendering apparatus includes:
1. and the configuration file generation module is used for writing the configuration file required by the rendering engine. And the rendering engine generates a complete application program through the configuration file. The configuration file type is a json file, and comprises the following steps:
1) the global theme definition file is mainly used for configuring the overall style of an application program, and specifically comprises the following steps: theme colors, navigation bar styles, status bar styles, and the like.
2) The root view controller file is mainly used for determining the type of the root view of the application program, and comprises the following steps: a general default style, a top navigation style (uinnavigationcontroller), a bottom navigation style (UITabBarController), etc.
3) The page file, each page of the application program corresponds to a page configuration file, and the file mainly comprises:
a) basic configuration information of the page, such as unique identification, name and type of the page.
b) A virtual tree structure of the sub-view in the page. The page is formed by combining a plurality of controls in a specific hierarchical structure, and the virtual tree structure of the page records the hierarchical structures of all the controls of the page.
c) Layout constraint information of the child view. The hierarchical structure of the controls on the page forms a certain dependency relationship, each control has its own dependent view, which is called parent view relative to the control and child view relative to the parent view. The layout constraint information of the sub-view is used for determining the position information of each control on the page so as to facilitate page layout.
d) And (4) data binding relation of the page and the child view. The page and each sub-view on the page are used for bearing certain service information, the data binding relation is determined, namely the service data borne by the sub-views are determined, and the assignment of the view presentation content is facilitated through the bound data identification.
e) Event processing logic for pages and child views. The page and the sub-view on the page bear certain user interaction logic, and the interaction logic bears individual user behavior events. By defining event handling logic, user interaction is accomplished in the program through the triggering of these events.
4) The register file is mainly used for storing the register information of each page of the application program, so that the rendering engine can quickly search the corresponding page information.
2. And a dynamic code generation module. Runtime is a set of bottom pure C language API, OC codes are finally converted into Runtime codes by a compiler, a function calling mode is determined through a message mechanism, and the OC is also used as a basis of a dynamic language. The dynamic code generation module utilizes the iOS Runtime characteristic, uses Runtime to dynamically generate classes defined in the registration file, adds attributes, methods and events required in the classes, and dynamically generates classes required by page rendering in the execution process of the application program, wherein the classes do not actually correspond to resource files and are only stored in a memory, and instance objects of the classes are generated when needed, and the instance objects follow the memory management rules of the iOS system.
3. And registering the module. And generating a page instance block code block of the corresponding page through page registration data defined in the registration file. A block code block is an anonymous function with values of automatic variables (i.e. local variables). After the block code block of the page instance is registered and generated, when the page needs to be displayed, the page instance is generated by calling the block code block corresponding to the page.
4. The rendering module comprises a virtual tree generating module and a view instance generating module and is used for analyzing the page file, and the process comprises the following steps:
1) and carrying out page basic configuration, and assigning basic information of the pages in the configuration file to the page example.
2) And analyzing the child view description in the page configuration to generate a virtual view tree.
3) And corresponding to the basic component according to the configuration file and the virtual view tree, and loading each sub-view to the page by traversing the view tree.
4) And adding position constraint information and width and height information to the sub-views through layout description in the configuration file, and completely rendering the page.
5. The data binding module comprises a method implementation module and a binding write-in module, and has the following two functions:
1) and correspondingly binding the data binding rule appointed by each view in the page configuration file with the corresponding attribute in the generated page instance.
2) And performing data request by using the API address of the server side appointed in the configuration file, performing data analysis on the request result, and performing data filling on each sub-view according to the analysis result and the data rule appointed in the configuration file.
6. An event processing module:
1) event processing is achieved by using an event reflection mechanism in the iOS application development language Objective-C language. The iOS system Foundation framework provides developers with some method-reflective APIs through which operations such as converting strings into SELs (pointers to class member methods, but unlike function pointers in the C language, function pointers directly hold addresses of methods, but SELs are only method numbers) can be performed. Due to the dynamic nature of the OC language, these operations all occur at runtime, where a specific instance can be selected to be created and which method to invoke dynamically, and these operations can even be controlled by parameters passed back by the server. Therefore, by using the message mechanism of the iOS, Target and IMP (a function pointer, which stores the address of the method) of the event are agreed, and then the method processing logic agreed in advance is called.
2) Event processing is performed through routing. The invention comprises a self-defined page routing component, and can create corresponding routes for each page. And event processing such as pushing, jumping and the like among the pages is carried out through the routing components and the routing information appointed by the pages. The routing component may also perform inter-page data transfers at page hops.
To sum up, the interface rendering apparatus based on the iOS application according to the embodiment of the present invention first responds to a page creation requirement to obtain a corresponding root view stack bottom page instance to generate a virtual tree, then maps the virtual tree onto a view component to create a sub-view instance, generates the view instance according to the sub-view instance and the root view stack bottom page instance, and then searches a corresponding method implementation from a configuration file according to a method definition of the root view stack bottom page instance to bind a corresponding method responder and the method implementation and then writes the method implementation into the method definition, which can meet the requirement of application dynamics, improve page rendering performance, improve development efficiency, and avoid hardware call limitation.
The embodiment of the present invention further provides a specific implementation manner of a computer device, which can implement all steps in the interface rendering method based on the iOS application in the foregoing embodiment. Fig. 10 is a block diagram of a computer device in an embodiment of the present invention, and referring to fig. 10, the computer device specifically includes the following:
a processor (processor)1001 and a memory (memory) 1002.
The processor 1001 is configured to call a computer program in the memory 1002, and when the processor executes the computer program, the processor implements all steps in the interface rendering method based on the iOS application in the foregoing embodiment, for example, when the processor executes the computer program, the processor implements the following steps:
responding to a page creation requirement to obtain a corresponding root view stack bottom page example, and analyzing a page sub-view corresponding to the root view stack bottom page example to generate a virtual tree;
mapping the virtual tree to a view component to create a sub-view example, and generating the view example according to the sub-view example and the page example at the bottom of the root view stack;
searching a corresponding method from a configuration file according to the method definition of the page example at the bottom of the stack of the root view;
binding a method responder corresponding to the method realization with the method realization, and writing the bound method realization into the method definition.
To sum up, the computer device of the embodiment of the present invention first responds to the page creation requirement to obtain the corresponding root view stack bottom page instance to generate the virtual tree, then maps the virtual tree onto the view component to create the sub-view instance, generates the view instance according to the sub-view instance and the root view stack bottom page instance, and then searches the corresponding method implementation from the configuration file according to the method definition of the root view stack bottom page instance to bind the corresponding method responder and the method implementation and then writes the method implementation into the method definition, which can meet the requirement of application dynamics, improve the page rendering performance, improve the development efficiency, and avoid the hardware call limitation.
An embodiment of the present invention further provides a computer-readable storage medium capable of implementing all steps in the interface rendering method based on the iOS application in the foregoing embodiment, where the computer-readable storage medium stores a computer program, and the computer program, when executed by a processor, implements all steps of the interface rendering method based on the iOS application in the foregoing embodiment, for example, when the processor executes the computer program, implements the following steps:
responding to a page creation requirement to obtain a corresponding root view stack bottom page example, and analyzing a page sub-view corresponding to the root view stack bottom page example to generate a virtual tree;
mapping the virtual tree to a view component to create a sub-view example, and generating the view example according to the sub-view example and the page example at the bottom of the root view stack;
searching a corresponding method from a configuration file according to the method definition of the page example at the bottom of the stack of the root view;
binding a method responder corresponding to the method realization with the method realization, and writing the bound method realization into the method definition.
To sum up, the computer-readable storage medium of the embodiment of the present invention first responds to the page creation requirement to obtain the corresponding root view stack bottom page instance to generate the virtual tree, then maps the virtual tree onto the view component to create the sub-view instance, generates the view instance according to the sub-view instance and the root view stack bottom page instance, and then searches the corresponding method implementation from the configuration file according to the method definition of the root view stack bottom page instance to bind the corresponding method responder and the method implementation and then writes the method implementation into the method definition, which can meet the requirement of application dynamics, improve the page rendering performance, improve the development efficiency, and avoid the hardware call limitation.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.
Those of skill in the art will further appreciate that the various illustrative logical blocks, units, and steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate the interchangeability of hardware and software, various illustrative components, elements, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design requirements of the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present embodiments.
The various illustrative logical blocks, or elements, or devices described in connection with the embodiments disclosed herein may be implemented or performed with a general purpose processor, a digital signal processor, an Application Specific Integrated Circuit (ASIC), a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A general-purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a digital signal processor and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a digital signal processor core, or any other similar configuration.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may be stored in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. For example, a storage medium may be coupled to the processor such the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an ASIC, which may be located in a user terminal. In the alternative, the processor and the storage medium may reside in different components in a user terminal.
In one or more exemplary designs, the functions described above in connection with the embodiments of the invention may be implemented in hardware, software, firmware, or any combination of the three. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media that facilitate transfer of a computer program from one place to another. Storage media may be any available media that can be accessed by a general purpose or special purpose computer. For example, such computer-readable media can include, but is not limited to, RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to carry or store program code in the form of instructions or data structures and which can be read by a general-purpose or special-purpose computer, or a general-purpose or special-purpose processor. Additionally, any connection is properly termed a computer-readable medium, and, thus, is included if the software is transmitted from a website, server, or other remote source via a coaxial cable, fiber optic cable, twisted pair, Digital Subscriber Line (DSL), or wirelessly, e.g., infrared, radio, and microwave. Such discs (disk) and disks (disc) include compact disks, laser disks, optical disks, DVDs, floppy disks and blu-ray disks where disks usually reproduce data magnetically, while disks usually reproduce data optically with lasers. Combinations of the above may also be included in the computer-readable medium.