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

OSCAddressSpace is the primary means of interacting with the OSC address space described in the OSC specification. This class is optional- it's not needed for basic OSC message sending/receiving. More...

#import <OSCAddressSpace.h>

Inherits OSCNode.

Instance Methods

(void) - renameAddress:to:
 Renames 'before' to 'after'. Sub-nodes stay with their owners! Can also be though of as a "move".
 
(void) - setNode:forAddress:
 If 'n' is nil, the node at the passed address will be deleted (as will any of its sub-nodes)
 
(OSCNode *) - findNodeForAddress:createIfMissing:
 Tries to find the node at the passed address, creating it (and any missing interim nodes) in the process if appropriate. Returns an instance of OSCNode which is already retained by the address space- if you're going to keep a weak ref to this OSCNode, become its delegate so you can be informed of its deletion.
 
(NSMutableArray *) - findNodesMatchingAddress:
 This method uses regex to find matches. path components may be regex strings- this returns all the nodes that match every component in the passed address/address array!
 
(void) - dispatchMessage:
 Sends the passed message to the appropriate node in the address space- this is how you pass received OSC data from a source (like an OSCInPort) to your address space. First it finds the OSCNode corresponding to the passed message's address, and then calls "dispatchMessage:" on it, which ultimately results in the node's delegates acquiring the passed OSC message.
 
- Instance Methods inherited from OSCNode
(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.
 
(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!
 

Class Methods

(id) + mainAddressSpace
 Returns the main instance of the OSC address space (and creates it if necessary)
 

Additional Inherited Members

- Properties inherited from OSCNode
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

OSCAddressSpace is the primary means of interacting with the OSC address space described in the OSC specification. This class is optional- it's not needed for basic OSC message sending/receiving.

There should only ever be one instance of OSCAddressSpace, which is automatically created when the class is initialized- you should not create another instance of this class. The main instance may be retrieved by the class method +[OSCAddressSpace mainAddressSpace] or by the class variable _mainVVOSCAddressSpace.

OSCAddressSpace is your application's main way of dealing with the OSC address space- if you need to dispatch a message, set, rename, or delete a node, you should do via the main instance of this class. OSCAddressSpace is a subclass of OSCNode- the entire address space is made up of OSCNodes (nodes within nodes), and each "node" represents a discrete destination address. The single instance of OSCAddressSpace is just the topmost node (for the address "/").

The basic workflow for address spaces is relatively straightforward: first locate (or create) an OSCNode instance using the OSCAddressSpace class. If you'd like to receive messages dispatched to that address in the OSC address space, add an instance of something to the node as a delegate. OSCAddressSpace has a couple high-level methods for doing basic manipulation of the address space.


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