vvopensource
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Groups Pages
Instance Methods | Properties
OSCNode Class Reference

OSCNode describes a single destination for OSC addresses. The OSC address space is made up of many different nodes. This class is optional- it is not used for basic OSC message sending/receiving, and only gets used if you start working with OSCAddressSpace. More...

#import <OSCNode.h>

Inherits NSObject.

Inherited by OSCAddressSpace.

Instance Methods

(NSComparisonResult) - nodeNameCompare:
 Convenience method so nodes may be sorted by name.
 
(void) - removeFromAddressSpace
 Call this to remove an instance of OSCNode from the address space.
 
(void) - addDelegate:
 Adds the passed object to the receiving node's array of delegates- must conform to OSCNodeDelegateProtocol.
 
(void) - removeDelegate:
 Removes the passed object from the receiving node's array of delegates.
 
(void) - dispatchMessage:
 Sends the passed message to all of the node's delegates- it does NOT parse the address at all (it's assumed that the passed message's address points to this instance of OSCNode). If the passed message is a query, this tries to assemble a reply (either from the queryDelegate or automatically if autoQueryReply is enabled) which is sent to the main address space.
 
(OSCMessage *) - generateAutomaticResponseForQuery:
 Generates a default reply for a query of the passed type. if "autoQueryReply" is enabled, this is how the reply is generated- this is a discrete method so query delegates can quickly generate query replies without having to implement reply methods in every query delegate class!
 

Properties

NSString * nodeName
 Sets or gets the node's local name. The node "/A/B/C" would return "C".
 
NSString * fullName
 Sets or gets the node's full address. The node "/A/B/C" would return "/A/B/C".
 
MutLockArraynodeContents
 Read-only, returns nil or a threadsafe array of OSCNode instances "inside" me.
 
OSCNodeType nodeType
 Nodes can have a basic "type", which is useful for sorting and organization.
 
OSCMessagelastReceivedMessage
 The last message sent to this node is retained (the message is retained instead of the value because messages can have multiple values)
 
OSCValuelastReceivedValue
 Convenience method for returning the first value from the last received message.
 
BOOL autoQueryReply
 Only used for the OSC query protocol. NO by default. if YES and the queryDelegate is nil or doesn't respond to one of the delegate methods or returns nil from one of the delegate methods, the OSCNode will try to automatically respond to the query.
 
id< OSCNodeQueryDelegatequeryDelegate
 Only used for the OSC query protocol. nil by default, NOT retained, must respond to the OSCNodeQueryDelegate protocol; unlike "normal" delegates, an OSCNode has a single query delegate...
 

Detailed Description

OSCNode describes a single destination for OSC addresses. The OSC address space is made up of many different nodes. This class is optional- it is not used for basic OSC message sending/receiving, and only gets used if you start working with OSCAddressSpace.

The OSC specification describes a slash-delineated address space- as messages are received, they are dispatched to the described address. An OSCNode represents a single unique destination in the OSC address space. OSCNodes may have subnodes and have a non-retaining reference to their parent node (unless they're top-level, in which case their parent node is nil). They retain a copy of the last message dispatched directly to this node for convenience. OSCNodes pass the OSC messages they receive to your application via the node's delegates- an instance of OSCNode has zero or more delegates. These delegates must support the OSCNodeDelegateProtocol, and the delegate should be removed from the node before the delegate is released. Correspondingly, the node will inform all its delegates of its impending release so weak references to the node may be destroyed.

If you want to work with an instance of OSCNode, you need to acquire or work with it from the main OSCAddressSpace. Do not just start creating OSCNode instances on your own; there's no point, they're only useful if they're part of an address space. This documentation exists in case you want to explore the address space or get/set properties of an OSCNode. The documentation only covers a fraction of the contents of the header files.

Generally speaking, it's a good idea for each instance of OSCNode to have a discrete type, as this makes it easier to browse and filter the hierarchy of OSCNode instances that make up the OSC address space. Most of the documented methods here are simply for querying basic properties of the OSCNode instance or doing simple message dispatch.


The documentation for this class was generated from the following files: