C# Класс LCM.LCM.LCM

Lightweight Communications and Marshalling C#.NET implementation
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Close ( ) : void

Call this function to release all resources used by the LCM instance. After calling this function, the LCM instance should consume no resources, and cannot be used to receive or transmit messages.

LCM ( ) : System

Create a new LCM object, connecting to one or more URLs. If no URL is specified, the environment variable LCM_DEFAULT_URL is used. If that environment variable is not defined, then the default URL is used.

Publish ( string channel, LCMEncodable e ) : void

Publish an LCM-defined type on a channel. If more than one URL was specified, the message will be sent on each.

Publish ( string channel, byte data, int offset, int length ) : void

Publish raw data on a channel, bypassing the LCM type specification. If more than one URL was specified when the LCM object was created, the message will be sent on each.

Publish ( string channel, string s ) : void

Publish a string on a channel. This method does not use the LCM type definitions and thus is not type safe. This method is primarily provided for testing purposes and may be removed in the future.

Subscribe ( string regex, LCMSubscriber sub ) : void

Subscribe to all channels whose name matches the regular expression. Note that to subscribe to all channels, you must specify ".*", not "*".

SubscribeAll ( LCMSubscriber sub ) : void

A convenience function that subscribes to all LCM channels.

Unsubscribe ( string regex, LCMSubscriber sub ) : void

Remove this particular regex/subscriber pair (UNTESTED AND API MAY CHANGE). If regex is null, all subscriptions for 'sub' are cancelled. If subscriber is null, any previous subscriptions matching the regular expression will be cancelled. If both 'sub' and 'regex' are null, all subscriptions will be cancelled.

Приватные методы

Метод Описание
ReceiveMessage ( string channel, byte data, int offset, int length ) : void

Not for use by end users. Provider back ends call this method when they receive a message. The subscribers that match the channel name are synchronously notified.

Описание методов

Close() публичный Метод

Call this function to release all resources used by the LCM instance. After calling this function, the LCM instance should consume no resources, and cannot be used to receive or transmit messages.
public Close ( ) : void
Результат void

LCM() публичный Метод

Create a new LCM object, connecting to one or more URLs. If no URL is specified, the environment variable LCM_DEFAULT_URL is used. If that environment variable is not defined, then the default URL is used.
public LCM ( ) : System
Результат System

Publish() публичный Метод

Publish an LCM-defined type on a channel. If more than one URL was specified, the message will be sent on each.
public Publish ( string channel, LCMEncodable e ) : void
channel string channel name
e LCMEncodable encodable object to send
Результат void

Publish() публичный Метод

Publish raw data on a channel, bypassing the LCM type specification. If more than one URL was specified when the LCM object was created, the message will be sent on each.
public Publish ( string channel, byte data, int offset, int length ) : void
channel string channel name
data byte data byte array
offset int offset of the data to write
length int length of the data to write
Результат void

Publish() публичный Метод

Publish a string on a channel. This method does not use the LCM type definitions and thus is not type safe. This method is primarily provided for testing purposes and may be removed in the future.
public Publish ( string channel, string s ) : void
channel string channel name
s string string to publich
Результат void

Subscribe() публичный Метод

Subscribe to all channels whose name matches the regular expression. Note that to subscribe to all channels, you must specify ".*", not "*".
public Subscribe ( string regex, LCMSubscriber sub ) : void
regex string regular expression determining the channels to subscribe
sub LCMSubscriber subscribing object providing callback
Результат void

SubscribeAll() публичный Метод

A convenience function that subscribes to all LCM channels.
public SubscribeAll ( LCMSubscriber sub ) : void
sub LCMSubscriber subscribing object providing callback
Результат void

Unsubscribe() публичный Метод

Remove this particular regex/subscriber pair (UNTESTED AND API MAY CHANGE). If regex is null, all subscriptions for 'sub' are cancelled. If subscriber is null, any previous subscriptions matching the regular expression will be cancelled. If both 'sub' and 'regex' are null, all subscriptions will be cancelled.
public Unsubscribe ( string regex, LCMSubscriber sub ) : void
regex string regular expression determining the channels to unsubscribe
sub LCMSubscriber unsubscribing object
Результат void