1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.BL.Entities;
using Tango.BL.Enumerations;
using Tango.PMR.Diagnostics;
namespace Tango.PPC.Common.EventLogging
{
/// <summary>
/// Represents a database events logger.
/// </summary>
public interface IEventLogger
{
/// <summary>
/// Occurs when a new machine event has been received.
/// </summary>
event EventHandler<MachinesEvent> EventReceived;
/// <summary>
/// Occurs when a machine event has been resolved.
/// </summary>
event EventHandler<MachinesEvent> EventResolved;
/// <summary>
/// Logs the specified machine event.
/// </summary>
/// <param name="machineEvent">The machine event.</param>
void Log(MachinesEvent machineEvent);
/// <summary>
/// Logs the specified event type.
/// </summary>
/// <param name="eventType">Type of the event.</param>
/// <param name="message">The message.</param>
void Log(EventTypes eventType, String message);
/// <summary>
/// Logs the specified hardware event.
/// </summary>
/// <param name="hardwareEvent">The hardware event.</param>
void Log(Event hardwareEvent);
/// <summary>
/// Logs the specified exception using the <see cref="EventTypes.ApplicationException"/>.
/// </summary>
/// <param name="exception">The exception.</param>
void Log(Exception exception);
/// <summary>
/// Logs the specified exception using the <see cref="EventTypes.ApplicationException"/>.
/// </summary>
/// <param name="exception">The exception.</param>
void Log(Exception exception, String description);
/// <summary>
/// Logs the specified message using the <see cref="EventTypes.ApplicationInformation"/>.
/// </summary>
/// <param name="message">The message.</param>
void Log(String message);
/// <summary>
/// Immediately saves all pending events to database.
/// </summary>
void FlushAll();
}
}
*buffer)
{
assert(message->base.descriptor == &stub_ext_flash_write_request__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
StubExtFlashWriteRequest *
stub_ext_flash_write_request__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (StubExtFlashWriteRequest *)
protobuf_c_message_unpack (&stub_ext_flash_write_request__descriptor,
allocator, len, data);
}
void stub_ext_flash_write_request__free_unpacked
(StubExtFlashWriteRequest *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &stub_ext_flash_write_request__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
static const ProtobufCFieldDescriptor stub_ext_flash_write_request__field_descriptors[5] =
{
{
"",
1,
PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_INT32,
offsetof(StubExtFlashWriteRequest, has_wordtowrite1),
offsetof(StubExtFlashWriteRequest, wordtowrite1),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"",
2,
PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_INT32,
offsetof(StubExtFlashWriteRequest, has_wordtowrite2),
offsetof(StubExtFlashWriteRequest, wordtowrite2),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"",
3,
PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_INT32,
offsetof(StubExtFlashWriteRequest, has_wordtowrite3),
offsetof(StubExtFlashWriteRequest, wordtowrite3),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"",
4,
PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_INT32,
offsetof(StubExtFlashWriteRequest, has_wordtowrite4),
offsetof(StubExtFlashWriteRequest, wordtowrite4),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"",
5,
PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_INT32,
offsetof(StubExtFlashWriteRequest, has_wordtowrite5),
offsetof(StubExtFlashWriteRequest, wordtowrite5),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned stub_ext_flash_write_request__field_indices_by_name[] = {
0, /* field[0] = WordToWrite1 */
1, /* field[1] = WordToWrite2 */
2, /* field[2] = WordToWrite3 */
3, /* field[3] = WordToWrite4 */
4, /* field[4] = WordToWrite5 */
};
static const ProtobufCIntRange stub_ext_flash_write_request__number_ranges[1 + 1] =
{
{ 1, 0 },
{ 0, 5 }
};
const ProtobufCMessageDescriptor stub_ext_flash_write_request__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"",
"",
"",
"",
sizeof(StubExtFlashWriteRequest),
5,
stub_ext_flash_write_request__field_descriptors,
stub_ext_flash_write_request__field_indices_by_name,
1, stub_ext_flash_write_request__number_ranges,
(ProtobufCMessageInit) stub_ext_flash_write_request__init,
NULL,NULL,NULL /* reserved[123] */
};
|