L-S-B Broadcast Technologies GmbH. Ember Gadget Interface. Ember Interface. Representing and controlling devices with Ember

Size: px
Start display at page:

Download "L-S-B Broadcast Technologies GmbH. Ember Gadget Interface. Ember Interface. Representing and controlling devices with Ember"

Transcription

1 Ember Gadget Interface Ember Interface Representing and controlling devices with Ember 1

2 Date: 06/2010 Version: Draft 7 Author: Marius Keuck Draft 4 Draft 5 Draft 6 Draft 7 New Chapter about Audio Level Meters, Minor diagram design changes Minor Changes Added an explanation about how to disable specific entries in an enumeration. Added a description of the optimized algorithm that can be used to transmit PPM Streams. 2

3 Contents Contents Introduction Ember Node Tags Class Overview Creating a tree The sample frame Node identifier Building the tree Sending the tree Glow Wrapper Receiving a tree Asynchronous reader Traversing the message Directory requests Audio Level Meters Default stream transmission method Optimized stream transmission method Programming guidelines Code listings

4 1. Introduction 1.1 Ember This document describes the usage of the Ember library, which is designed to encode and decode data that is transferred between two devices or applications. In this case, Ember is used to represent gadget frames and similar device types, like audio routers. Almost like XML, Ember uses a hierarchical structure, where each single element is a node, which may have one parent and a list of children. To get an overview of the Ember specification, it is recommended to read the Ember specification draft document first. 1.2 Node Tags An Ember node has a tag, which contains a class type and a 32 Bit number. The class is an enumeration which indicates the meaning of a node, and can have one of the following values: Application, Context and Private. Application specific nodes have the same meaning, wherever they appear. The meaning of context and private specific nodes depends on their location. The exact usage will be described later. 1.3 Class Overview Ember offers several node types in order to be able to construct a tree hierarchy, and to provide the possibility to store different types of data, like strings or integer values. The following image shows the classes of the most common types: 4

5 Image 1 Ember Class hierarchy Basically, there are two different kinds of nodes: containers, which may have several children, and leafs, which contain the data. The classes Set and Sequence are derived from the Container and have an important difference: while a Set may be empty and each child node is optional, a Sequence represents an ordered collection or list type, where the order of the child nodes may be significant. Also, tag uniqueness is not required in a Sequence, but recommended. The Frame is the root node; it encapsulates the rest of the tree and internally uses a Crc node which is used to assure that Ember messages are received correctly. All other node types may be added to the Frame as needed. The DynamicContainer is a special version of the Set. It can either be a Sequence, or a Set, depending on the nodes inserted. As long as each node tag only exists one, the dynamic container is a set. But as soon as it detects a duplicate entry it becomes a sequence. Because of that flexibility, the DynamicContainer is used to represent gadget nodes and parameters. It can also be used to create a category of parameters, like Gains or Sources. The following chapter demonstrates how to build an Ember tree that represents a simple gadget frame. 5

6 2. Creating a tree 2.1 The sample frame A single gadget frame normally contains several slots, where each slot may contain a card which provides specific functionalities, like a de-embedder or a frame synchronizer. These cards have individual parameters. The sample frame used here has four different slots, called Slot 1 to 4. Both, the frame and the slots are represented as nodes. As shown in the image below, the frame node is the parent of the four slots. Parent Node Frame 1 (1) Slot 1 (2) Slot 2 (3) Slot 1 Number is 2 Slot 3 (4) Slot 4 (5) Image Node identifier In Ember, a node can be identified by its tag number and identifier string. In the image above, the values put in brackets are that number, and the text is the identifier. Both, the identifier and the number must be unique, as long as they appear in the same level. That means that all child nodes of our Frame 1 must have different identifier strings. Otherwise it would be impossible to clearly identify the slot nodes. But it would be all right if each slot had a parameter called Name, because then each name parameter has a different parent and is in another level. The following image shows both, a valid and an invalid configuration. 6

7 Frame 1 Frame 1 Slot 1 Name Two nodes may not have the same identifier on the same layer Slot Name Slot 2 Slot Name Name Image 3 The left sample contains no errors, but on the right side Slot appears twice in the same level, which should be avoided! 2.3 Building the tree But now let s see some code, which creates the structure of our frame and the four slots. CEmber_DynamicContainer *pframe, *pslot1, *pslot2, *pslot3, *pslot4 pframe = new CEmber_DynamicContainer(eeBerClass_Context, 1); pslot1 = new CEmber_DynamicContainer(eeBerClass_Context, 2); pslot2 = new CEmber_DynamicContainer(eeBerClass_Context, 3); pslot3 = new CEmber_DynamicContainer(eeBerClass_Context, 4); pslot4 = new CEmber_DynamicContainer(eeBerClass_Context, 5); pframe->insert(pslot1); pframe->insert(pslot2); pframe->insert(pslot3); pframe->insert(pslot4); When we create a DynamicContainer, we have to pass the class type and the number, which is part of our identifier. For nodes, always the ContextSpecific class type is used. With the code above we create a node structure equal to the graph of image 2. The identifier strings are still missing, but it is an easy task to add them as well: 7

8 pframe->insert(eeberclass_application, 1, Frame 1 ); pslot1->insert(eeberclass_application, 1, Slot 1 ); pslot2->insert(eeberclass_application, 1, Slot 2 ); pslot3->insert(eeberclass_application, 1, Slot 3 ); pslot4->insert(eeberclass_application, 1, Slot 4 ); The Insert method of a node offers several overloads, one for each data type available. Internally, the Insert method creates a String leaf. Again, the first argument is the class type, and the second one is the number. But here, the number is not used to identify a node; it is used to determine a property. An identifier string is always an Application specific context with tag number 1. That means that anytime a node with that combination appears, it is an identifier string. The following list shows all current properties, which can be set for a node or a parameter. #define GLOW_Identifier (1) #define GLOW_Description (2) #define GLOW_Value (3) #define GLOW_Minimum (4) #define GLOW_Maximum (5) #define GLOW_Writeable (6) #define GLOW_Format (7) #define GLOW_Enumeration (8) #define GLOW_Factor (9) #define GLOW_Online (10) #define GLOW_Formula (11) #define GLOW_Step (12) #define GLOW_Default (13) #define GLOW_Command (14) #define GLOW_Command_Directory (32) The first two constants, Identifier and Description, and Online, are used for both, nodes and parameters. By default, the identifier string should be displayed in a tree view. But if a description is set, it should be used instead. The other values describe parameter properties: Value Double, integer, string The parameter value. This can be a string, a double or an integer. Minimum Double, integer If the value range is limited, this property indicates the smallest value possible. Maximum Double, integer If the value range is limited, this property indicates the largest value possible. Writeable Boolean Set this property to true, if the parameter can be changed. Format String A C-style format string, like %lf db. Enumeration String If there is an enumeration, all possible values are transmitted in a single string, where each 8

9 Factor choice is separated by the newline character (LF). Internally, the index of the choice is used to determine the current selection. It is also possible to disable specific enumeration entries. This can be done by adding the ~ character as first character of the current string. A complete enumeration could look like this: Disabled\nEnabled\n~Ignore. A factor can be used to represent an internal integer value as floating point value. Online Boolean Boolean value indicating the online state of a node or a parameter. Formula String This property may be used to provide a UPN term which computes the internal value to a display value and vice versa. Step Double, integer This value is added or subtracted from the current parameter value, if it is being incremented or decremented Command Boolean If true, the parameter is a button. So now we have an Ember tree representing our sample frame and its four slots, including their identifier strings. The next step is to add some parameters. The following image shows a small collection of parameters the first two slots may have. Slot 1 Slot 2 Volume Channels Device Name Format Comment Reset Device Name Image 4 Both slots have a parameter called Device Name, which is a read-only string. The table below gives a more detailed description of the other parameters. 9

10 Name Type Sample values Volume Double 0.0 db Channels Integer [0, 4] Format Integer (enumeration) 16:9, 4:3 Comment String Sample frame Reset String (Command) Reset The Volume parameter has no range, but a format string ( %lf db ). Only properties that are used have to be inserted to the parameter description. But before we can add the properties, we have to create the nodes the representing the parameters. This is very similar to the node creation described before. CEmber_DynamicContainer *pvolume; pvolume = new CEmber_DynamicContainer(eeBerClass_Private, 6); pvolume->insert(eeberclass_application, GLOW_Identifier, Volume ); pslot1->insert(pvolume); Instead of the Context class, parameters use the Private specific class. Otherwise, we couldn t distinguish between a node and a parameter if a node contains both. The value 6 is the tag number. Then, the identifier Volume is inserted to the parameter node and the parameter is attached to the slot. That procedure must be repeated for every parameter. After the nodes had been created, the parameter properties may be added, as shown in the following sample. // Volume pvolume->insert(eeberclass_application, GLOW_Value, 0.0); pvolume->insert(eeberclass_application, GLOW_Format, %lf db ); pvolume->insert(eeberclass_application, GLOW_Writeable, 1); // Channels pchannels->insert(eeberclass_application, GLOW_Value, 1); pchannels->insert(eeberclass_application, GLOW_Minimum, 0); pchannels->insert(eeberclass_application, GLOW_Maximum, 4); pchannels->insert(eeberclass_application, GLOW_Writeable, 1); // Format CString senumeration = 16:9\n4:3 ; pformat->insert(eeberclass_application, GLOW_Value, 0); pformat->insert(eeberclass_application, GLOW_Writeable, 1); pformat->insert(eeberclass_application, GLOW_Enumeration, senumeration); // Comment pcomment->insert(eeberclass_application, GLOW_Value, Sample frame ); 10

11 pcomment->insert(eeberclass_application, GLOW_Writeable, 1); // Reset preset->insert(eeberclass_application, GLOW_Value, Reset ); preset->insert(eeberclass_application, GLOW_Command, 1); That s it; all relevant properties are inserted to the parameter nodes. So now, we have created the complete structure that represents the sample frame. 2.4 Sending the tree The next task is to send the complete tree to a connected client application, which normally wants to display or control the devices and parameters of the sample frame. As mentioned before, the root node must be a Frame. So we create one and attach the gadget frame structure to it. CEmber_Frame EmberFrame; EmberFrame.Insert(pFrame); Afterwards, the frame must be encoded to a byte array, which can then be sent to a connected client. The Ember library provides several targets the encoded data can be written to, like memory or files. In most cases a byte array is needed to send data. The class CEmber_Output_Memory does exactly that. It automatically creates a buffer which is large enough to store the complete encoded data. The code below shows how to encode the tree and send it to a client. 11

12 // The EmberFrame is an instance of CEmber_Frame which has been created // before and contains the complete sample frame structure. CEmber_Output_Memory Output; // Encode data EmberFrame.Write(&Output); // Output now contains the encoded data. // Finally, send data. SendToClients(Output.GetMemory(), Output.GetLength()); All steps necessary to create a structure representing a gadget frame, and transmitting the encoded data to connected client applications are now known. 2.5 Glow Wrapper To make the creation of a tree even easier, two more classes called CGlow_Node and CGlow_Parameter were designed. Both make use of the Ember library and are derived from CEmber_DynamicContainer, but are not part of it. The Glow Node is used to represent frames, slots and similar devices, which only need an identifier. The Glow Parameter is used, as the name indicates, to represent parameters and their properties. So, instead of writing something like pvolume->insert(eeberclass_application, GLOW_Value, 0.0); We now can write: pvolume->setvalue(0.0); These two classes can t reduce the number of lines significantly, but they increase readability and save the two constant parameters used to create the tag. For every property, a method is available to set it. Both classes are listed at the end of this document. When using the Glow wrappers, the creation of the tree looks like this: CGlow_Node *pframe = new CGlow_Node(1); CGlow_Node *pslot1 = new CGlow_Node(2); CGlow_Node *pslot2 = new CGlow_Node(3); CGlow_Node *pslot3 = new CGlow_Node(4); CGlow_Node *pslot4 = new CGlow_Node(5); pframe->setidentifier( Frame 1 ); pslot1->setidentifier( Slot 1 ); pslot2->setidentifier( Slot 2 ); pslot3->setidentifier( Slot 3 ); 12

13 pslot4->setidentifier( Slot 4 ); // Attach slots to the frame pframe->insert(pslot1); pframe->insert(pslot2); pframe->insert(pslot3); pframe->insert(pslot4); // Volume CGlow_Parameter *pvolume = new CGlow_Parameter(6, Volume ); pvolume->setvalue(0.0); pvolume->setformat( %lf db ); pvolume->setwriteable(true); // Channels CGlow_Parameter *pchannels = new CGlow_Parameter(7, Channels ); pchannels->setvalue(1); pchannels->setrange(0, 4); pchannels->setwriteable(true); // Format CString senumeration = 16:9\n4:3 ; CGlow_Parameter *pformat = new CGlow_Parameter(8, Format ); pformat->setvalue(0); pformat->setwriteable(true); pformat->setenumeration(senumeration); // Attach parameters to slot 1 pslot1->insert(pvolume); pslot1->insert(pchannels); pslot1->insert(pformat); 13

14 3. Receiving a tree Both, client and server applications must be able to receive and decode an Ember tree correctly. In the first step, the message must be decoded. This is done by a so called reader class. When using a protocol like TCP/IP, the message may be split into several packets, so it is hardly possible to detect when a message is complete. At that point, the asynchronous reader the Ember Library offers comes in handy. 3.1 Asynchronous reader Every byte received by a socket or something similar is appended to the reader by calling its ReadBytes method. For each node that has been decoded correctly, the virtual method OnItemReady is called, which can be used to detect if the tree is complete. That can be done by querying if the current node has a parent or not, because the only node that has no parent, is the frame node. So we derive a class from CEmber_AsyncReader_Framing and override its OnItemReady method to be able to process complete messages. class CMyAsyncReader: public CEmber_AsyncReader_Framing protected: virtual void OnItemReady(CEmber_Node *pnode) // When the current node has no parent, we received // a complete message. if(pnode->getparent() == NULL) OnEventEmber(pNode); ; 3.2 Traversing the message Every time OnEventEmber is called, a complete Ember tree must be processed and handled. Assume a user wants to set the Volume parameter of Slot 1 to the value 1.0. The tree necessary to control that parameter looks like that: 14

15 Frame 1 (1) Slot 1 (2) Volume (6) 1 Parameter value Image 5 Frame 1 and Slot 1 are nodes with the class set to context specific, while Volume uses the private class, because it is a parameter. The value 1 is application specific, because it is a property (GLOW_Value). In an xml like style, the tree looks like this: // A = Application // C = Context // P = Private <A 0xFFFFACDC> <C 1> <C 2> <P 6> <A 3> <value>1</value> </A 3> </P 6> </C 2> </C 1> </A> The numbers behind the class types (A, C, P) are the tag numbers. The first number (0xFFFFACDC) identifies the frame, C1 and C2 are the two nodes Frame 1 and Slot 1, P6 is the parameter and A3 (3 = GLOW_Value) the value. The identifier strings must not be sent to the server application, because they are already known. It is necessary to transmit the complete structure from the root node down to the parameter. Otherwise, it would be impossible to assign the Volume to the correct device, because there could be several parameters with the same name. What we have to do now is to traverse the tree to detect what the message wants us to do. 15

16 We start with the Frame node, which always is the root. It never has any neighbors, but it may have several child nodes. So we ask the root to return its first child, and check its tag class and number, which says C1. At this point, we now that this is a node, and there should be a method that searches for the associated structure, which would then return our Frame 1. Next, we ask C1 to return its first child node, which results in C2. Again, we should call a method that checks, if that node really exists and if it is a sub-node of C1 as well. In this case, it is Slot 1. The first child of Slot 1 is P6. P indicates a parameter, Volume. At this point, we should check if the value node exists. If so, we simply call a Get method of that node to retrieve the value that should be set (1.0). The response message that should be sent to the client looks exactly the same, as long as 1 is a valid value. If it is invalid, the message should contain the current value, like 0. Again, the identifier string and other properties don t have to be transmitted, because the client application is already aware of it. The following code sample should clarify the process described above. void OnEventEmber(CEmber_Node *pnode) // Get a handle that is used to traverse the child nodes POSITION Next = pnode->getfirstchildposition(); while(next) CEmber_Node *pwalk = pnode->getnextchild(next); // Check the class type switch(pwalk->gettagclass()) // Node? case eeberclass_contextspecific: OnEventEmber_Node(pWalk); break; // Parameter? case eeberclass_private: OnEventEmber_Parameter(pWalk); break; void OnEventEmber_Node(CEmber_Node *pnode) // At this point we should check, if the node really exists. // The complete structure has to be checked as well, to assure // that the parents are in correct order and so on. if(nodeexists(pnode) == false) return; 16

17 // If the node is valid, continue traversing the tree OnEventEmber(pNode); void OnEventEmber_Parameter(CEmber_Node *pnode) // Again, check that the parameter is valid if(parameterexists(pnode) == false) return; // Here we have to check, if the value node exists CNode *pvalue = pnode->get(eeberclass_application, GLOW_Value); // If so, get the value and set it. if(pvalue!= NULL) switch(pvalue->gettype()) case eebertype_integer: int nvalue = ((CEmber_Leaf_Int *) pvalue)->getvalue(); >GetValue(); // Method to set the parameter internally SetParameterInt(nValue); break; case eebertype_real: double dvalue = ((CEmber_Leaf_Double*)pValue)- // Method to set the parameter internally SetParameterDouble(dValue); break; case eebertype_utf8string: char *szvalue = ((CEmber_Leaf_UTF8 *) pvalue)->getvalue(); // Method to set the parameter internally SetParameterString(szValue); break; Basically, that is everything necessary to walk through the tree. But a few things are still missing. The validation of the path is very important. You have to check, if the current node or parameter is in the right location, i.e. if Slot 1 (C2) really is the child of Frame 1 (C1). The implementation depends on how a device handles its parameters internally. 17

18 Another thing missing is the construction of the response. One possibility to implement that is to add a second parameter of type CEmber_Node* to the OnEvent methods, which is called presponse. After the validation of the current node or parameter succeeds, it can be added to the response node. After the tree has been traversed, the response node can be sent to the clients connected. 3.3 Directory requests The last thing missing is the so called directory request. Before a client can display or control any parameters, it must query the structure of a device. That is what the directory request is used for. Exactly like parameter properties, it is a node with application context, but the tag number is 32 (GLOW_Command_Directory). When a client application connects to a device, it knows nothing about it. So the first action is to perform a directory request, which looks like that: <C 0xFFFFACDC> <A 32> </A 32> </C> That means, that the application requests the root node. Depending on the size of the tree, it makes sense to only send one level or the entire tree, if it isn t that large. To reduce traffic, we could only send the Frame 1 node. A response would look like this: <C 0xFFFFACDC> <C 1> <A 1>Frame 1</A 1> </C 1> </C> The application can now display Frame 1 in its tree view, for example. When a user clicks on it, the child nodes of that frame have to be requested: <C 0xFFFFACDC> <C 1> <A 32> </A 32> </C 1> </C> The message requests the child nodes of Frame 1 (C1). The response looks like this: <C 0xFFFFACDC> <C 1> <C 2> <A 1>Slot 1</A 1> <P 6> <A 1>Volume</A 1> 18

19 </P 6> // Rest of the parameter list </C 2> <C 3> <A 1>Slot 2</A 1> </C> // Parameter list </C 3> </C 1> When a node contains parameters, it should add them to the response as well. To handle that kind of request, the switch statement in the OnEventEmber method has to be extended with a case eeberclass_application label. If the tag number is 32 (GLOW_Command_Directory), a directory request must be processed. This means that the child nodes and their parameters should be sent to the client who requested the directory. 19

20 4. Audio Level Meters This chapter shortly describes how to integrate an Audio Level stream into Ember. Since Build 1272 of vsmstudio, two different methods are implemented that may be used to transmit stream information. Basically, a stream is provided as a normal parameter. It does not display the current stream value, but is used to subscribe to a stream instead. So usually a stream parameter is called Stream and it is an enumeration with a single entry called Stream as well. When a user wants to use that stream, it needs to be dragged on to a Peak meter control. After that, a Stream subscribe command will be sent to the device offering the stream. The following table shows the commands that were introduced for streams: GLOW_Command_Directory (32) GLOW_Command_Unsubscribe (33) GLOW_Command_Stream (34) GLOW_Command_StreamSubscribe (1001) GLOW_Command_StreamUnsubscribe (1002) Already known, used to request a directory Indicates that the system is no longer interested in any child nodes. Indicates, that a parameter contains a stream Stream unsubscribe Stream subscribe 4.1 Default stream transmission method Let s assume we have a root node called Audio Stream (number 1) which offers a stream parameter (number 2). When requesting the directory of that node, the ember message would look as if the stream parameter were a normal enumeration (with a single entry). As soon as it is used on a panel, the subscribe command would be sent: <C 0xFFFFACDC> <C 1> <P 2> <C 34> <P 1001> </P 1001> </C 34> </P 2> </C 1> </C> 20

21 The <C 34> indicates that this is a stream parameter, while the <P 1001> indicates the Subscribe command. An Unsubscribe would look similar to this, except that the 1001 would be replaced by a A stream should only send its current values when it has an active subscription. This mechanism reduces the network traffic and may even reduce the CPU load of the device that provides the stream values. The message to notify an updated stream value of 7 for example would then look like this: <C 0xFFFFACDC> <C 1> <P 2> </C> <C 34> <P 3> <value>7</value> </P 3> </C 34> </P 2> </C 1> The <P 3> indicates that this is a stream value. The type should always be integer. The unit is 1/32 db. 4.2 Optimized stream transmission method This method requires less CPU performance because it uses a smaller structure to transmit the PPM values. It uses a container that contains a reference to the stream and the current stream value. To be able to use this mechanism, a reference number must be send to vsmstudio when a subscription command is received. To do this, first create a directory response that contains the parameter. Then, a stream command node must be added to the parameter node and an identifier must be added to the command node. The following example shows a correct response to a subscription command: 21

22 <C 0xFFFFACDC> <C 1> <P 2> </C> <C 34> <P 1> <value>unique Stream Identifier</value> </P 1> </C 34> </P 2> </C 1> Instead of the stream value, we just send the stream identifier once. The following code sample shows how to append the required information to a parameter node, where the stream identifier is 1000: CGlow_Parameter *pparameter = ; // Create the stream command node CGlow_Node *pstreamnode = new CGlow_Node(GLOW_Command_Stream); // Attach the stream identifier pstreamnode->insert(eeberclass_private, GLOW_Identifier, 1000); // Attach the stream node to the parameter pparameter->insert(pstreamnode); When a stream is subscribed, all changes should be sent to the vsmstudio automatically. Now, instead of always constructing the complete tree from the root node to the stream parameter, only a single container with identifier and value pairs is required. The root node must be marked as such and must still have the root number as tag number. When the root identifier is 1 as in the samples above, and stream 1000 changed its value to -128, the following structure is created to notify this update: <C 0xFFFFACDC> <C 1> <A 34> <P 1000> <A 3> -128 </A 3> </P 1000> <P 1001> <A 3> -64 </A 3> </P 1001> </A 34> <A 1000>true</A 1000> </C 1> </C> 22

23 <C 1> is the root node of the tree, which is indicated by the <A 1000>true</A 1000>, where 1000 is the number for GLOW_RootTag. <A 34> is dynamic container (34 = Stream command) that must contain the stream identifiers and their values. <P 1000> is the stream identifier and <A 3> represents its current value. <P 1001> is a second stream to show that this container may have as many entries as necessary. The following code constructs the tree listed above, without the stream 1001: CEmber_Frame *pframe = ; CGlow_Node *proot = new CGlow_Node(1); CEmber_Node *pstreamcontainer = new CEmber_DynamicContainer(eeBerClass_Application, GLOW_Command_Stream); proot->setroot(true); proot->insert(pstreamcontainer); pframe->insert(prootnode); // Add the stream CGlow_Parameter *pstream = new CGlow_Parameter(1000); pparameter->setvalue(-128); pstreamcontainer->insert(pparameter); 23

24 5. Programming guidelines In most cases server application providing some parameters don t have to keep the complete Ember tree in memory. Normally, there are only three situations when an Ember tree has to be constructed. The first one is the response to a directory request. If parameters are included to that request, they should contain all known properties, because the client may not know them yet. The second situation is the response to a value update request. And third is an automatically generated message when a parameter changed its value. To avoid polling, a server should always send its responses to every client connected. These responses don t require the identifier strings or parameter properties. It can be assumed that they are already known, because before a parameter can be changed, the directory must have been queried by the client application. 24

25 6. Code listings class CGlow_Node : public CEmber_DynamicContainer public: CGlow_Node(DWORD dwnumber) : CEmber_DynamicContainer(eeBerClass_ContextSpecific, dwnumber) void SetIdentifier(PCSTR szidentifier) Insert(eeBerClass_Application, GLOW_Identifier, szidentifier); void SetDescription(PCSTR szdescription) Insert(eeBerClass_Application, GLOW_Description, szdescription); void SetOnline(bool bonline = true) Insert(eeBerClass_Application, GLOW_Online, bonline); void SetOffline(bool boffline = true) Insert(eeBerClass_Application, GLOW_Online,!bOffline); ; class CGlow_Parameter : public CEmber_DynamicContainer public: CGlow_Parameter(DWORD dwnumber) : CEmber_DynamicContainer(eeBerClass_Private, dwnumber) CGlow_Parameter(DWORD dwnumber, PCSTR szdescription) : CEmber_DynamicContainer(eeBerClass_Private, dwnumber) SetDescription(szDescription); public: void SetIdentifier(PCSTR szidentifier) Insert(eeBerClass_Application, GLOW_Identifier, szidentifier); void SetDescription(PCSTR szdescription) Insert(eeBerClass_Application, GLOW_Description, szdescription); 25

26 void SetEnumeration(PCSTR szenumeration) Insert(eeBerClass_Application, GLOW_Enumeration, szenumeration); void SetFormat(PCSTR szformat) Insert(eeBerClass_Application, GLOW_Format, szformat); void SetFormula(PCSTR szformula) Insert(eeBerClass_Application, GLOW_Formula, szformula); void SetWriteable(bool bwriteable = true) Insert(eeBerClass_Application, GLOW_Writeable, bwriteable); void SetCommand(bool biscommand = true) Insert(eeBerClass_Application, GLOW_Command, biscommand); void SetOnline(bool bonline = true) Insert(eeBerClass_Application, GLOW_Online, bonline); void SetOffline(bool boffline = true) Insert(eeBerClass_Application, GLOW_Online,!bOffline); void SetValue(int nvalue) Insert(eeBerClass_Application, GLOW_Value, nvalue ); void SetValue(double dvalue) Insert(eeBerClass_Application, GLOW_Value, dvalue ); void SetValue(PCSTR szvalue) Insert(eeBerClass_Application, GLOW_Value, szvalue ); void SetDefault(int nvalue) Insert(eeBerClass_Application, GLOW_Default, nvalue ); void SetDefault(double dvalue) Insert(eeBerClass_Application, GLOW_Default, dvalue ); void SetStep(int nvalue) Insert(eeBerClass_Application, GLOW_Step, nvalue ); void SetStep(double dvalue) Insert(eeBerClass_Application, GLOW_Step, dvalue ); 26

27 ; void SetMinimum(int nminimum) Insert(eeBerClass_Application, GLOW_Minimum, nminimum ); void SetMinimum(double dminimum) Insert(eeBerClass_Application, GLOW_Minimum, dminimum ); void SetMaximum(int nmaximum) Insert(eeBerClass_Application, GLOW_Maximum, nmaximum ); void SetMaximum(double dmaximum) Insert(eeBerClass_Application, GLOW_Maximum, dmaximum ); void SetFactor(int nfactor) Insert(eeBerClass_Application, GLOW_Factor, nfactor ); void SetRange(int nminimum, int nmaximum) SetMinimum(nMinimum); SetMaximum(nMaximum); void SetRange(double dminimum, double dmaximum) SetMinimum(dMinimum); SetMaximum(dMaximum); 27

CS 142 Style Guide Grading and Details

CS 142 Style Guide Grading and Details CS 142 Style Guide Grading and Details In the English language, there are many different ways to convey a message or idea: some ways are acceptable, whereas others are not. Similarly, there are acceptable

More information

Lecture 3. COMP1006/1406 (the Java course) Summer M. Jason Hinek Carleton University

Lecture 3. COMP1006/1406 (the Java course) Summer M. Jason Hinek Carleton University Lecture 3 COMP1006/1406 (the Java course) Summer 2014 M. Jason Hinek Carleton University today s agenda assignments 1 (graded) & 2 3 (available now) & 4 (tomorrow) a quick look back primitive data types

More information

Introduction to Programming Using Java (98-388)

Introduction to Programming Using Java (98-388) Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;

More information

DAB/MOT Data Carousel System Support Library Interface Definition

DAB/MOT Data Carousel System Support Library Interface Definition DAB/MOT Data Carousel System Support Library Interface Definition D. Knox & O. Gardiner 98-0003-001/1.3 5th Jul 1999 ENSIGMA Ltd Turing House Station Road Chepstow GWENT NP6 5PB Ensigma Ltd. Page 2 of

More information

CMSC 341 Lecture 10 Binary Search Trees

CMSC 341 Lecture 10 Binary Search Trees CMSC 341 Lecture 10 Binary Search Trees John Park Based on slides from previous iterations of this course Review: Tree Traversals 2 Traversal Preorder, Inorder, Postorder H X M A K B E N Y L G W UMBC CMSC

More information

Section 05: Solutions

Section 05: Solutions Section 05: Solutions 1. Memory and B-Tree (a) Based on your understanding of how computers access and store memory, why might it be faster to access all the elements of an array-based queue than to access

More information

Units 0 to 4 Groovy: Introduction upto Arrays Revision Guide

Units 0 to 4 Groovy: Introduction upto Arrays Revision Guide Units 0 to 4 Groovy: Introduction upto Arrays Revision Guide Second Year Edition Name: Tutorial Group: Groovy can be obtained freely by going to http://groovy-lang.org/download Page 1 of 8 Variables Variables

More information

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

Weiss Chapter 1 terminology (parenthesized numbers are page numbers) Weiss Chapter 1 terminology (parenthesized numbers are page numbers) assignment operators In Java, used to alter the value of a variable. These operators include =, +=, -=, *=, and /=. (9) autoincrement

More information

CSE100. Advanced Data Structures. Lecture 13. (Based on Paul Kube course materials)

CSE100. Advanced Data Structures. Lecture 13. (Based on Paul Kube course materials) CSE100 Advanced Data Structures Lecture 13 (Based on Paul Kube course materials) CSE 100 Priority Queues in Huffman s algorithm Heaps and Priority Queues Time and space costs of coding with Huffman codes

More information

CHAPTER 7 ARRAYS: SETS OF SIMILAR DATA ITEMS

CHAPTER 7 ARRAYS: SETS OF SIMILAR DATA ITEMS CHAPTER 7 ARRAYS: SETS OF SIMILAR DATA ITEMS Computers process information and usually they need to process masses of information. In previous chapters we have studied programs that contain a few variables

More information

Java for Programmers Course (equivalent to SL 275) 36 Contact Hours

Java for Programmers Course (equivalent to SL 275) 36 Contact Hours Java for Programmers Course (equivalent to SL 275) 36 Contact Hours Course Overview This course teaches programmers the skills necessary to create Java programming system applications and satisfies the

More information

! Tree: set of nodes and directed edges. ! Parent: source node of directed edge. ! Child: terminal node of directed edge

! Tree: set of nodes and directed edges. ! Parent: source node of directed edge. ! Child: terminal node of directed edge Trees (& Heaps) Week 12 Gaddis: 20 Weiss: 21.1-3 CS 5301 Spring 2015 Jill Seaman 1 Tree: non-recursive definition! Tree: set of nodes and directed edges - root: one node is distinguished as the root -

More information

CSCI 171 Chapter Outlines

CSCI 171 Chapter Outlines Contents CSCI 171 Chapter 1 Overview... 2 CSCI 171 Chapter 2 Programming Components... 3 CSCI 171 Chapter 3 (Sections 1 4) Selection Structures... 5 CSCI 171 Chapter 3 (Sections 5 & 6) Iteration Structures

More information

AVDECC clarifications. Part 2 AEM commands. Revision 4 [WIP] 8/5/2016

AVDECC clarifications. Part 2 AEM commands. Revision 4 [WIP] 8/5/2016 AVDECC clarifications Part 2 AEM commands Revision 4 [WIP] 8/5/2016 1 1. Introduction The goal of this document is to clarify some parts of the AVDECC specification (IEEE Std. 1722.1-2013). This document

More information

Trees, Part 1: Unbalanced Trees

Trees, Part 1: Unbalanced Trees Trees, Part 1: Unbalanced Trees The first part of this chapter takes a look at trees in general and unbalanced binary trees. The second part looks at various schemes to balance trees and/or make them more

More information

Software Development & Education Center. Java Platform, Standard Edition 7 (JSE 7)

Software Development & Education Center. Java Platform, Standard Edition 7 (JSE 7) Software Development & Education Center Java Platform, Standard Edition 7 (JSE 7) Detailed Curriculum Getting Started What Is the Java Technology? Primary Goals of the Java Technology The Java Virtual

More information

CS 231 Data Structures and Algorithms, Fall 2016

CS 231 Data Structures and Algorithms, Fall 2016 CS 231 Data Structures and Algorithms, Fall 2016 Dr. Bruce A. Maxwell Department of Computer Science Colby College Course Description Focuses on the common structures used to store data and the standard

More information

EDMS. Architecture and Concepts

EDMS. Architecture and Concepts EDMS Engineering Data Management System Architecture and Concepts Hannu Peltonen Helsinki University of Technology Department of Computer Science Laboratory of Information Processing Science Abstract

More information

Out: April 19, 2017 Due: April 26, 2017 (Wednesday, Reading/Study Day, no late work accepted after Friday)

Out: April 19, 2017 Due: April 26, 2017 (Wednesday, Reading/Study Day, no late work accepted after Friday) CS 215 Fundamentals of Programming II Spring 2017 Programming Project 7 30 points Out: April 19, 2017 Due: April 26, 2017 (Wednesday, Reading/Study Day, no late work accepted after Friday) This project

More information

MID TERM MEGA FILE SOLVED BY VU HELPER Which one of the following statement is NOT correct.

MID TERM MEGA FILE SOLVED BY VU HELPER Which one of the following statement is NOT correct. MID TERM MEGA FILE SOLVED BY VU HELPER Which one of the following statement is NOT correct. In linked list the elements are necessarily to be contiguous In linked list the elements may locate at far positions

More information

Lecture 2, September 4

Lecture 2, September 4 Lecture 2, September 4 Intro to C/C++ Instructor: Prashant Shenoy, TA: Shashi Singh 1 Introduction C++ is an object-oriented language and is one of the most frequently used languages for development due

More information

Programming II (CS300)

Programming II (CS300) 1 Programming II (CS300) Chapter 11: Binary Search Trees MOUNA KACEM mouna@cs.wisc.edu Fall 2018 General Overview of Data Structures 2 Introduction to trees 3 Tree: Important non-linear data structure

More information

CS211, LECTURE 20 SEARCH TREES ANNOUNCEMENTS:

CS211, LECTURE 20 SEARCH TREES ANNOUNCEMENTS: CS211, LECTURE 20 SEARCH TREES ANNOUNCEMENTS: OVERVIEW: motivation naive tree search sorting for trees and binary trees new tree classes search insert delete 1. Motivation 1.1 Search Structure continuing

More information

a graph is a data structure made up of nodes in graph theory the links are normally called edges

a graph is a data structure made up of nodes in graph theory the links are normally called edges 1 Trees Graphs a graph is a data structure made up of nodes each node stores data each node has links to zero or more nodes in graph theory the links are normally called edges graphs occur frequently in

More information

Simulator Driver PTC Inc. All Rights Reserved.

Simulator Driver PTC Inc. All Rights Reserved. 2017 PTC Inc. All Rights Reserved. 2 Table of Contents Simulator Driver 1 Table of Contents 2 Simulator Driver 3 Overview 3 Setup 4 Channel Properties General 4 Channel Properties Write Optimizations 5

More information

Objectives. In this chapter, you will:

Objectives. In this chapter, you will: Objectives In this chapter, you will: Become familiar with functions, special symbols, and identifiers in C++ Explore simple data types Discover how a program evaluates arithmetic expressions Learn about

More information

Accessing Arbitrary Hierarchical Data

Accessing Arbitrary Hierarchical Data D.G.Muir February 2010 Accessing Arbitrary Hierarchical Data Accessing experimental data is relatively straightforward when data are regular and can be modelled using fixed size arrays of an atomic data

More information

Data Structures in Java

Data Structures in Java Data Structures in Java Lecture 9: Binary Search Trees. 10/7/015 Daniel Bauer 1 Contents 1. Binary Search Trees. Implementing Maps with BSTs Map ADT A map is collection of (key, value) pairs. Keys are

More information

1B1b Implementing Data Structures Lists, Hash Tables and Trees

1B1b Implementing Data Structures Lists, Hash Tables and Trees 1B1b Implementing Data Structures Lists, Hash Tables and Trees Agenda Classes and abstract data types. Containers. Iteration. Lists Hash Tables Trees Note here we only deal with the implementation of data

More information

Objectives. Chapter 2: Basic Elements of C++ Introduction. Objectives (cont d.) A C++ Program (cont d.) A C++ Program

Objectives. Chapter 2: Basic Elements of C++ Introduction. Objectives (cont d.) A C++ Program (cont d.) A C++ Program Objectives Chapter 2: Basic Elements of C++ In this chapter, you will: Become familiar with functions, special symbols, and identifiers in C++ Explore simple data types Discover how a program evaluates

More information

Basic program The following is a basic program in C++; Basic C++ Source Code Compiler Object Code Linker (with libraries) Executable

Basic program The following is a basic program in C++; Basic C++ Source Code Compiler Object Code Linker (with libraries) Executable Basic C++ Overview C++ is a version of the older C programming language. This is a language that is used for a wide variety of applications and which has a mature base of compilers and libraries. C++ is

More information

Chapter 2 Basic Elements of C++

Chapter 2 Basic Elements of C++ C++ Programming: From Problem Analysis to Program Design, Fifth Edition 2-1 Chapter 2 Basic Elements of C++ At a Glance Instructor s Manual Table of Contents Overview Objectives s Quick Quizzes Class Discussion

More information

Chapter 2: Basic Elements of C++

Chapter 2: Basic Elements of C++ Chapter 2: Basic Elements of C++ Objectives In this chapter, you will: Become familiar with functions, special symbols, and identifiers in C++ Explore simple data types Discover how a program evaluates

More information

CS61C Machine Structures. Lecture 4 C Pointers and Arrays. 1/25/2006 John Wawrzynek. www-inst.eecs.berkeley.edu/~cs61c/

CS61C Machine Structures. Lecture 4 C Pointers and Arrays. 1/25/2006 John Wawrzynek. www-inst.eecs.berkeley.edu/~cs61c/ CS61C Machine Structures Lecture 4 C Pointers and Arrays 1/25/2006 John Wawrzynek (www.cs.berkeley.edu/~johnw) www-inst.eecs.berkeley.edu/~cs61c/ CS 61C L04 C Pointers (1) Common C Error There is a difference

More information

Valkyrie REST Server

Valkyrie REST Server Valkyrie REST Server User Manual This document describes how to build client applications for Xena Valkyrie REST server. Last updated: 2018-09-27 CONTENTS General... 4 Functionality... 4 Audience and Prerequisites...

More information

Chapter 2: Basic Elements of C++ Objectives. Objectives (cont d.) A C++ Program. Introduction

Chapter 2: Basic Elements of C++ Objectives. Objectives (cont d.) A C++ Program. Introduction Chapter 2: Basic Elements of C++ C++ Programming: From Problem Analysis to Program Design, Fifth Edition 1 Objectives In this chapter, you will: Become familiar with functions, special symbols, and identifiers

More information

ZooKeeper Recipes and Solutions

ZooKeeper Recipes and Solutions by Table of contents 1 A Guide to Creating Higher-level Constructs with ZooKeeper...2 1.1 Important Note About Error Handling... 2 1.2 Out of the Box Applications: Name Service, Configuration, Group Membership...2

More information

CS 231 Data Structures and Algorithms Fall Recursion and Binary Trees Lecture 21 October 24, Prof. Zadia Codabux

CS 231 Data Structures and Algorithms Fall Recursion and Binary Trees Lecture 21 October 24, Prof. Zadia Codabux CS 231 Data Structures and Algorithms Fall 2018 Recursion and Binary Trees Lecture 21 October 24, 2018 Prof. Zadia Codabux 1 Agenda ArrayQueue.java Recursion Binary Tree Terminologies Traversal 2 Administrative

More information

LAB C Translating Utility Classes

LAB C Translating Utility Classes LAB C Translating Utility Classes Perform the following groups of tasks: LabC1.s 1. Create a directory to hold the files for this lab. 2. Create and run the following two Java classes: public class IntegerMath

More information

Trees. Chapter 6. strings. 3 Both position and Enumerator are similar in concept to C++ iterators, although the details are quite different.

Trees. Chapter 6. strings. 3 Both position and Enumerator are similar in concept to C++ iterators, although the details are quite different. Chapter 6 Trees In a hash table, the items are not stored in any particular order in the table. This is fine for implementing Sets and Maps, since for those abstract data types, the only thing that matters

More information

-Device. -Physical or virtual thing that does something -Software + hardware to operate a device (Controller runs port, Bus, device)

-Device. -Physical or virtual thing that does something -Software + hardware to operate a device (Controller runs port, Bus, device) Devices -Host -CPU -Device -Controller device) +memory +OS -Physical or virtual thing that does something -Software + hardware to operate a device (Controller runs port, Bus, Communication -Registers -Control

More information

7.1 Optional Parameters

7.1 Optional Parameters Chapter 7: C++ Bells and Whistles A number of C++ features are introduced in this chapter: default parameters, const class members, and operator extensions. 7.1 Optional Parameters Purpose and Rules. Default

More information

Largest Online Community of VU Students

Largest Online Community of VU Students WWW.VUPages.com http://forum.vupages.com WWW.VUTUBE.EDU.PK Largest Online Community of VU Students MIDTERM EXAMINATION SEMESTER FALL 2003 CS301-DATA STRUCTURE Total Marks:86 Duration: 60min Instructions

More information

Armide Documentation. Release Kyle Mayes

Armide Documentation. Release Kyle Mayes Armide Documentation Release 0.3.1 Kyle Mayes December 19, 2014 Contents 1 Introduction 1 1.1 Features.................................................. 1 1.2 License..................................................

More information

C++ Important Questions with Answers

C++ Important Questions with Answers 1. Name the operators that cannot be overloaded. sizeof,.,.*,.->, ::,? 2. What is inheritance? Inheritance is property such that a parent (or super) class passes the characteristics of itself to children

More information

JUN / 04 VERSION 7.1 FOUNDATION

JUN / 04 VERSION 7.1 FOUNDATION JUN / 04 VERSION 7.1 FOUNDATION PVI EWS2OME www.smar.com Specifications and information are subject to change without notice. Up-to-date address information is available on our website. web: www.smar.com/contactus.asp

More information

ITI Introduction to Computing II

ITI Introduction to Computing II ITI 1121. Introduction to Computing II Marcel Turcotte School of Electrical Engineering and Computer Science Binary search tree (part I) Version of March 24, 2013 Abstract These lecture notes are meant

More information

Week 7 - More Java! this stands for the calling object:

Week 7 - More Java! this stands for the calling object: Week 7 - More Java! Variable Scoping, Revisited this Parameter Encapsulation & Principles of Information Hiding: Use of public and private within class API, ADT javadoc Variables of class Type Wrapper

More information

C++ Basics. Data Processing Course, I. Hrivnacova, IPN Orsay

C++ Basics. Data Processing Course, I. Hrivnacova, IPN Orsay C++ Basics Data Processing Course, I. Hrivnacova, IPN Orsay The First Program Comments Function main() Input and Output Namespaces Variables Fundamental Types Operators Control constructs 1 C++ Programming

More information

! Tree: set of nodes and directed edges. ! Parent: source node of directed edge. ! Child: terminal node of directed edge

! Tree: set of nodes and directed edges. ! Parent: source node of directed edge. ! Child: terminal node of directed edge Trees & Heaps Week 12 Gaddis: 20 Weiss: 21.1-3 CS 5301 Fall 2018 Jill Seaman!1 Tree: non-recursive definition! Tree: set of nodes and directed edges - root: one node is distinguished as the root - Every

More information

COSC 3311 Software Design Report 2: XML Translation On the Design of the System Gunnar Gotshalks

COSC 3311 Software Design Report 2: XML Translation On the Design of the System Gunnar Gotshalks Version 1.0 November 4 COSC 3311 Software Design Report 2: XML Translation On the Design of the System Gunnar Gotshalks 1 Introduction This document describes the design work and testing done in completing

More information

Crit-bit Trees. Adam Langley (Version )

Crit-bit Trees. Adam Langley (Version ) CRITBIT CWEB OUTPUT 1 Crit-bit Trees Adam Langley (agl@imperialviolet.org) (Version 20080926) 1. Introduction This code is taken from Dan Bernstein s qhasm and implements a binary crit-bit (alsa known

More information

Lesson 10A OOP Fundamentals. By John B. Owen All rights reserved 2011, revised 2014

Lesson 10A OOP Fundamentals. By John B. Owen All rights reserved 2011, revised 2014 Lesson 10A OOP Fundamentals By John B. Owen All rights reserved 2011, revised 2014 Table of Contents Objectives Definition Pointers vs containers Object vs primitives Constructors Methods Object class

More information

Operating guide. OPC server for ECL Comfort 310. Table of Contents

Operating guide. OPC server for ECL Comfort 310. Table of Contents Operating guide OPC server for ECL Comfort 310 Table of Contents 1. Introduction to Danfoss ECL OPC Server... 2 2. Configuring databases... 6 3. Exporting configuration data... 7 4. Importing data from

More information

Priority Queues and Binary Heaps. See Chapter 21 of the text, pages

Priority Queues and Binary Heaps. See Chapter 21 of the text, pages Priority Queues and Binary Heaps See Chapter 21 of the text, pages 807-839. A priority queue is a queue-like data structure that assumes data is comparable in some way (or at least has some field on which

More information

OOPs Concepts. 1. Data Hiding 2. Encapsulation 3. Abstraction 4. Is-A Relationship 5. Method Signature 6. Polymorphism 7. Constructors 8.

OOPs Concepts. 1. Data Hiding 2. Encapsulation 3. Abstraction 4. Is-A Relationship 5. Method Signature 6. Polymorphism 7. Constructors 8. OOPs Concepts 1. Data Hiding 2. Encapsulation 3. Abstraction 4. Is-A Relationship 5. Method Signature 6. Polymorphism 7. Constructors 8. Type Casting Let us discuss them in detail: 1. Data Hiding: Every

More information

Figure 1. A breadth-first traversal.

Figure 1. A breadth-first traversal. 4.3 Tree Traversals Stepping, or iterating, through the entries of a linearly ordered list has only two obvious orders: from front to back or from back to front. There is no obvious traversal of a general

More information

Introduction to pthreads

Introduction to pthreads CS 220: Introduction to Parallel Computing Introduction to pthreads Lecture 25 Threads In computing, a thread is the smallest schedulable unit of execution Your operating system has a scheduler that decides

More information

ITI Introduction to Computing II

ITI Introduction to Computing II ITI 1121. Introduction to Computing II Marcel Turcotte School of Electrical Engineering and Computer Science Binary search tree (part I) Version of March 24, 2013 Abstract These lecture notes are meant

More information

Lecture 26. Introduction to Trees. Trees

Lecture 26. Introduction to Trees. Trees Lecture 26 Introduction to Trees Trees Trees are the name given to a versatile group of data structures. They can be used to implement a number of abstract interfaces including the List, but those applications

More information

Multiple choice questions. Answer on Scantron Form. 4 points each (100 points) Which is NOT a reasonable conclusion to this sentence:

Multiple choice questions. Answer on Scantron Form. 4 points each (100 points) Which is NOT a reasonable conclusion to this sentence: Multiple choice questions Answer on Scantron Form 4 points each (100 points) 1. Which is NOT a reasonable conclusion to this sentence: Multiple constructors for a class... A. are distinguished by the number

More information

CHAPTER 7 OBJECTS AND CLASSES

CHAPTER 7 OBJECTS AND CLASSES CHAPTER 7 OBJECTS AND CLASSES OBJECTIVES After completing Objects and Classes, you will be able to: Explain the use of classes in Java for representing structured data. Distinguish between objects and

More information

Section 05: Solutions

Section 05: Solutions Section 05: Solutions 1. Asymptotic Analysis (a) Applying definitions For each of the following, choose a c and n 0 which show f(n) O(g(n)). Explain why your values of c and n 0 work. (i) f(n) = 5000n

More information

TREES. Tree Overview 9/28/16. Prelim 1 tonight! Important Announcements. Tree terminology. Binary trees were in A1!

TREES. Tree Overview 9/28/16. Prelim 1 tonight! Important Announcements. Tree terminology. Binary trees were in A1! //16 Prelim 1 tonight! :3 prelim is very crowded. You HAVE to follow these directions: 1. Students taking the normal :3 prelim (not the quiet room) and whose last names begin with A through Da MUST go

More information

void insert( Type const & ) void push_front( Type const & )

void insert( Type const & ) void push_front( Type const & ) 6.1 Binary Search Trees A binary search tree is a data structure that can be used for storing sorted data. We will begin by discussing an Abstract Sorted List or Sorted List ADT and then proceed to describe

More information

CHAPTER 7 OBJECTS AND CLASSES

CHAPTER 7 OBJECTS AND CLASSES CHAPTER 7 OBJECTS AND CLASSES OBJECTIVES After completing Objects and Classes, you will be able to: Explain the use of classes in Java for representing structured data. Distinguish between objects and

More information

Extra: B+ Trees. Motivations. Differences between BST and B+ 10/27/2017. CS1: Java Programming Colorado State University

Extra: B+ Trees. Motivations. Differences between BST and B+ 10/27/2017. CS1: Java Programming Colorado State University Extra: B+ Trees CS1: Java Programming Colorado State University Slides by Wim Bohm and Russ Wakefield 1 Motivations Many times you want to minimize the disk accesses while doing a search. A binary search

More information

Binary Trees. BSTs. For example: Jargon: Data Structures & Algorithms. root node. level: internal node. edge.

Binary Trees. BSTs. For example: Jargon: Data Structures & Algorithms. root node. level: internal node. edge. Binary Trees 1 A binary tree is either empty, or it consists of a node called the root together with two binary trees called the left subtree and the right subtree of the root, which are disjoint from

More information

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub Lebanese University Faculty of Science Computer Science BS Degree Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub 2 Crash Course in JAVA Classes A Java

More information

BASIC COMPUTATION. public static void main(string [] args) Fundamentals of Computer Science I

BASIC COMPUTATION. public static void main(string [] args) Fundamentals of Computer Science I BASIC COMPUTATION x public static void main(string [] args) Fundamentals of Computer Science I Outline Using Eclipse Data Types Variables Primitive and Class Data Types Expressions Declaration Assignment

More information

Word Found Meaning Innovation

Word Found Meaning Innovation AP CSP Quarter 1 Study Guide Vocabulary from Unit 1 & 3 Word Found Meaning Innovation A novel or improved idea, device, product, etc, or the development 1.1 thereof Binary 1.2 A way of representing information

More information

CSE100. Advanced Data Structures. Lecture 12. (Based on Paul Kube course materials)

CSE100. Advanced Data Structures. Lecture 12. (Based on Paul Kube course materials) CSE100 Advanced Data Structures Lecture 12 (Based on Paul Kube course materials) CSE 100 Coding and decoding with a Huffman coding tree Huffman coding tree implementation issues Priority queues and priority

More information

Principles of Computer Science

Principles of Computer Science Principles of Computer Science Binary Trees 08/11/2013 CSCI 2010 - Binary Trees - F.Z. Qureshi 1 Today s Topics Extending LinkedList with Fast Search Sorted Binary Trees Tree Concepts Traversals of a Binary

More information

1 OBJECT-ORIENTED PROGRAMMING 1

1 OBJECT-ORIENTED PROGRAMMING 1 PREFACE xvii 1 OBJECT-ORIENTED PROGRAMMING 1 1.1 Object-Oriented and Procedural Programming 2 Top-Down Design and Procedural Programming, 3 Problems with Top-Down Design, 3 Classes and Objects, 4 Fields

More information

Topics. Java arrays. Definition. Data Structures and Information Systems Part 1: Data Structures. Lecture 3: Arrays (1)

Topics. Java arrays. Definition. Data Structures and Information Systems Part 1: Data Structures. Lecture 3: Arrays (1) Topics Data Structures and Information Systems Part 1: Data Structures Michele Zito Lecture 3: Arrays (1) Data structure definition: arrays. Java arrays creation access Primitive types and reference types

More information

ZooKeeper Recipes and Solutions

ZooKeeper Recipes and Solutions by Table of contents 1 A Guide to Creating Higher-level Constructs with ZooKeeper...2 1.1 Out of the Box Applications: Name Service, Configuration, Group Membership... 2 1.2 Barriers... 2 1.3 Queues...

More information

Chapter 4 Defining Classes I

Chapter 4 Defining Classes I Chapter 4 Defining Classes I This chapter introduces the idea that students can create their own classes and therefore their own objects. Introduced is the idea of methods and instance variables as the

More information

Solution printed. Do not start the test until instructed to do so! CS 2604 Data Structures Midterm Spring Instructions:

Solution printed. Do not start the test until instructed to do so! CS 2604 Data Structures Midterm Spring Instructions: VIRG INIA POLYTECHNIC INSTITUTE AND STATE U T PROSI M UNI VERSI TY Instructions: Print your name in the space provided below. This examination is closed book and closed notes, aside from the permitted

More information

Java: introduction to object-oriented features

Java: introduction to object-oriented features Chair of Software Engineering Carlo A. Furia, Marco Piccioni, Bertrand Meyer Java: introduction to object-oriented features Chair of Software Engineering Carlo A. Furia, Marco Piccioni, Bertrand Meyer

More information

B2.52-R3: INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING THROUGH JAVA

B2.52-R3: INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING THROUGH JAVA B2.52-R3: INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING THROUGH JAVA NOTE: 1. There are TWO PARTS in this Module/Paper. PART ONE contains FOUR questions and PART TWO contains FIVE questions. 2. PART ONE

More information

DISTRIBUTED HIGH-SPEED COMPUTING OF MULTIMEDIA DATA

DISTRIBUTED HIGH-SPEED COMPUTING OF MULTIMEDIA DATA DISTRIBUTED HIGH-SPEED COMPUTING OF MULTIMEDIA DATA M. GAUS, G. R. JOUBERT, O. KAO, S. RIEDEL AND S. STAPEL Technical University of Clausthal, Department of Computer Science Julius-Albert-Str. 4, 38678

More information

Huffman Coding Assignment For CS211, Bellevue College (rev. 2016)

Huffman Coding Assignment For CS211, Bellevue College (rev. 2016) Huffman Coding Assignment For CS, Bellevue College (rev. ) (original from Marty Stepp, UW CSE, modified by W.P. Iverson) Summary: Huffman coding is an algorithm devised by David A. Huffman of MIT in 95

More information

Spring 2018 Mentoring 8: March 14, Binary Trees

Spring 2018 Mentoring 8: March 14, Binary Trees CSM 6B Binary Trees Spring 08 Mentoring 8: March 4, 08 Binary Trees. Define a procedure, height, which takes in a Node and outputs the height of the tree. Recall that the height of a leaf node is 0. private

More information

THIRD PARTY CONTROL PROTOCOL

THIRD PARTY CONTROL PROTOCOL THIRD PARTY CONTROL PROTOCOL 1 Introduction This 3rd-party control protocol applies to both the Solaro and Neutrino series DSP processors. The exact same protocol works on both series. Since the introduction

More information

Priority Queues and Binary Heaps. See Chapter 21 of the text, pages

Priority Queues and Binary Heaps. See Chapter 21 of the text, pages Priority Queues and Binary Heaps See Chapter 21 of the text, pages 807-839. A priority queue is a queue-like data structure that assumes data is comparable in some way (or at least has some field on which

More information

CSL 201 Data Structures Mid-Semester Exam minutes

CSL 201 Data Structures Mid-Semester Exam minutes CL 201 Data tructures Mid-emester Exam - 120 minutes Name: Roll Number: Please read the following instructions carefully This is a closed book, closed notes exam. Calculators are allowed. However laptops

More information

9/29/2016. Chapter 4 Trees. Introduction. Terminology. Terminology. Terminology. Terminology

9/29/2016. Chapter 4 Trees. Introduction. Terminology. Terminology. Terminology. Terminology Introduction Chapter 4 Trees for large input, even linear access time may be prohibitive we need data structures that exhibit average running times closer to O(log N) binary search tree 2 Terminology recursive

More information

CS102 Binary Search Trees

CS102 Binary Search Trees CS102 Binary Search Trees Prof Tejada 1 To speed up insertion, removal and search, modify the idea of a Binary Tree to create a Binary Search Tree (BST) Binary Search Trees Binary Search Trees have one

More information

CS 315 Software Design Homework 3 Preconditions, Postconditions, Invariants Due: Sept. 29, 11:30 PM

CS 315 Software Design Homework 3 Preconditions, Postconditions, Invariants Due: Sept. 29, 11:30 PM CS 315 Software Design Homework 3 Preconditions, Postconditions, Invariants Due: Sept. 29, 11:30 PM Objectives Defining a wellformed method to check class invariants Using assert statements to check preconditions,

More information

Test Requirement Catalog. Generic Clues, Developer Version

Test Requirement Catalog. Generic Clues, Developer Version Version 4..0 PART 1: DATA TYPES Test Requirement Catalog SIMPLE DATA TYPES... 4 BOOLEAN... 4 CASES... 4 COUNTS... 5 INTERVALS... 5 [LOW, HIGH] an interval that contains both LOW and HIGH... 6 [LOW, HIGH)

More information

Lecture 27. Binary Search Trees. Binary Search Trees

Lecture 27. Binary Search Trees. Binary Search Trees Lecture Binary Search Trees Binary Search Trees In the previous lecture, we defined the concept of binary search tree as a binary tree of nodes containing an ordered key with the following additional property.

More information

Decaf Language Reference Manual

Decaf Language Reference Manual Decaf Language Reference Manual C. R. Ramakrishnan Department of Computer Science SUNY at Stony Brook Stony Brook, NY 11794-4400 cram@cs.stonybrook.edu February 12, 2012 Decaf is a small object oriented

More information

Java How to Program, 10/e. Copyright by Pearson Education, Inc. All Rights Reserved.

Java How to Program, 10/e. Copyright by Pearson Education, Inc. All Rights Reserved. Java How to Program, 10/e Education, Inc. All Rights Reserved. Each class you create becomes a new type that can be used to declare variables and create objects. You can declare new classes as needed;

More information

Think of drawing/diagramming editors. ECE450 Software Engineering II. The problem. The Composite pattern

Think of drawing/diagramming editors. ECE450 Software Engineering II. The problem. The Composite pattern Think of drawing/diagramming editors ECE450 Software Engineering II Drawing/diagramming editors let users build complex diagrams out of simple components The user can group components to form larger components......which

More information

Advanced Java Concepts Unit 5: Trees. Notes and Exercises

Advanced Java Concepts Unit 5: Trees. Notes and Exercises Advanced Java Concepts Unit 5: Trees. Notes and Exercises A Tree is a data structure like the figure shown below. We don t usually care about unordered trees but that s where we ll start. Later we will

More information

Threads CS1372. Lecture 13. CS1372 Threads Fall / 10

Threads CS1372. Lecture 13. CS1372 Threads Fall / 10 Threads CS1372 Lecture 13 CS1372 Threads Fall 2008 1 / 10 Threads 1 In order to implement concurrent algorithms, such as the parallel bubble sort discussed previously, we need some way to say that we want

More information

External Data Representation (XDR)

External Data Representation (XDR) External Data Representation (XDR) Prof. Chuan-Ming Liu Computer Science and Information Engineering National Taipei University of Technology Taipei, TAIWAN NTUT, TAIWAN 1 Introduction This chapter examines

More information

Makefiles Makefiles should begin with a comment section of the following form and with the following information filled in:

Makefiles Makefiles should begin with a comment section of the following form and with the following information filled in: CS 215 Fundamentals of Programming II C++ Programming Style Guideline Most of a programmer's efforts are aimed at the development of correct and efficient programs. But the readability of programs is also

More information

MonoLog - Logging and Monitoring Specifications

MonoLog - Logging and Monitoring Specifications The ObjectWeb Consortium Interface Specification MonoLog - Logging and Monitoring Specifications AUTHORS: S. Chassande-Barrioz (INRIA) CONTRIBUTORS: JB. Stefani (INRIA) B. Dumant (Kelua) Released: March

More information

Software Design and Analysis for Engineers

Software Design and Analysis for Engineers Software Design and Analysis for Engineers by Dr. Lesley Shannon Email: lshannon@ensc.sfu.ca Course Website: http://www.ensc.sfu.ca/~lshannon/courses/ensc251 Simon Fraser University Slide Set: 2 Date:

More information