2 // This file is part of the LWES .NET Binding (LWES.net)
4 // COPYRIGHT© 2009, Phillip Clark (phillip[at*flitbit[dot*org)
5 // original .NET implementation
7 // LWES.net is free software: you can redistribute it and/or modify
8 // it under the terms of the Lesser GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
12 // LWES.net is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // Lesser GNU General Public License for more details.
17 // You should have received a copy of the Lesser GNU General Public License
18 // along with LWES.net. If not, see <http://www.gnu.org/licenses/>.
20 namespace Org
.Lwes
.Emitter
29 /// Interface for classes that emit Events into the light-weight event system.
32 /// This interface makes the use of the IDisposable pattern explicit; implementations
33 /// must guarantee that cleanup occured before returning from Dispose.
35 public interface IEventEmitter
: IDisposable
38 /// The ip address to which events are emitted.
40 /// <exception cref="System.InvalidOperationException">thrown if the emitter has already been initialized</exception>
47 /// The character encoding used when performing event IO.
49 /// <exception cref="System.InvalidOperationException">thrown if the emitter has already been initialized</exception>
50 SupportedEncoding Encoding
57 /// Indicates whether the emitter has been initialized.
65 /// The ip port to which events are emitted.
67 /// <exception cref="System.InvalidOperationException">thrown if the emitter has already been initialized</exception>
74 /// The event template database used by the emitter.
76 /// <exception cref="System.InvalidOperationException">thrown if the emitter has already been initialized</exception>
77 IEventTemplateDB TemplateDB
84 /// Indicates whether events issued from the emitter will validate
87 /// <exception cref="System.InvalidOperationException">thrown if the emitter has already been initialized</exception>
95 /// Creates an event type identified by the event name.
97 /// <param name="eventName">the event type's name</param>
98 /// <returns>a new LWES event instance</returns>
99 /// <exception cref="System.InvalidOperationException">thrown if the emitter has not been initialized</exception>
100 Event
CreateEvent(string eventName
);
103 /// Creates an event type identified by the event name.
105 /// <param name="eventName">the event type's name</param>
106 /// <param name="enc">encoding used when performing IO on the event</param>
107 /// <returns>a new LWES event instance</returns>
108 /// <exception cref="System.InvalidOperationException">thrown if the emitter has not been initialized</exception>
109 Event
CreateEvent(string eventName
, SupportedEncoding enc
);
112 /// Creates an event type identified by the event name.
114 /// <param name="eventName">the event type's name</param>
115 /// <param name="validate">whether the event is validated</param>
116 /// <returns>a new LWES event instance</returns>
117 /// <exception cref="System.InvalidOperationException">thrown if the emitter has not been initialized</exception>
118 Event
CreateEvent(string eventName
, bool validate
);
121 /// Creates an event type identified by the event name.
123 /// <param name="eventName">the event type's name</param>
124 /// <param name="validate">whether the event is validated</param>
125 /// <param name="enc">encoding used when performing IO on the event</param>
126 /// <returns>a new LWES event instance</returns>
127 /// <exception cref="System.InvalidOperationException">thrown if the emitter has not been initialized</exception>
128 Event
CreateEvent(string eventName
, bool validate
, SupportedEncoding enc
);
131 /// Emits an event to the event system.
133 /// <param name="evt">the event being emitted</param>
134 /// <exception cref="System.InvalidOperationException">thrown if the emitter has not been initialized</exception>
135 void Emit(Event evt
);
138 /// Initializes the emitter.