/////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                        Author: Christian Konecny 
/////////////////////////////////////////////////////////////////////////////////////////////////////
//
// ERROR-Messages for DistributionLayer
//
/////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////


/////////////// INITIALIZATION FAILURE //////////////////////////////////////////////////////////////
//
// Description: 
// ~~~~~~~~~~~~
// Something failed during initialization of the distribution-layer.
//
// Possible reasons: 
// ~~~~~~~~~~~~~~~~~
// - DistributionLayer-Instance has not be created successfuly
// - attaching faulty message mailbox fails because there is already another one
//   which has not been detached before.
// - EDistLayerCInterfaceAccount-Instance has not been created successfuly


10  = "Initialization failed",""
/////////////////////////////////////////////////////////////////////////////////////////////////////




/////////////// MESSAGE COULD NOT BE DELIVERED //////////////////////////////////////////////////////
//
// Description: 
// ~~~~~~~~~~~~
// Distribution layer could not find the corresponding receiver for a message which it was asked to
// deliver.
//
// Possible reasons: 
// ~~~~~~~~~~~~~~~~~
// - Sending application has specified a wrong ApplicationId/Board/Individual
// - Receiving application has not subscibed or with wrong parameters.
//
// The trace-message shows
// a) the message-header: Sender-ApplicationId, 
//                        Receiver-ApplicationId, 
//                        BoardPosition,
//                        Individual,
//                        DataSize,
// b) DataBufferSize,  (actual allocated amount of memory)
// c) Data (raw bytestream in target-byte order)


20  = "Faulty Message: Sender:{%1} Receiver:{%2} Board:{%3} Ind:{%4} DataSize:{%5} DataBufferSize:{%6} Data:{%8}","xxxxuulv"
/////////////////////////////////////////////////////////////////////////////////////////////////////




/////////////// FAULTY MESSAGE COULD NOT BE REPORTED ////////////////////////////////////////////////
//
// Description: 
// ~~~~~~~~~~~~
// Distribution layer wants to report a message which could not be delivered to an appropriate 
// receiver, but there is no faulty message mailbox assigned to it.
//
// Possible reasons: 
// ~~~~~~~~~~~~~~~~~
// - there was never assigned any faulty message mailbox (maybe distlayer-initialization failed)
// - faulty message mailbox has been detached for some reason...


21  = "Faulty Message cannot be reported because no FaultyMsgMailbox has been configured.",""
/////////////////////////////////////////////////////////////////////////////////////////////////////



/////////////// NULL-POINTER PROVIDED ////////////////////////////////////////////////
//
// Description: 
// ~~~~~~~~~~~~
// The client application did provide a NULL-pointer to any API-method.
//
// Possible reasons: 
// ~~~~~~~~~~~~~~~~~
// - Client application has not checked pointer validity. 
//
// The trace-message shows the method where this error was detected


30  = "Method {%1}: message pointer is NULL","s"
/////////////////////////////////////////////////////////////////////////////////////////////////////



/////////////// MESSAGE INCONSISTENT FAILURE 1 ////////////////////////////////////////////////
//
// Description: 
// ~~~~~~~~~~~~
// An OSE-Signal has to be converted to a Distribution-Layer Message object, but the header-elements
// are contradictory.
//
// DataSize > DataBufferSize
//
// DataSize.........valid information length within the data-area of the message
// DataBufferSize...Number of bytes actually allocated for the data-area.
//
//
// Possible reasons: 
// ~~~~~~~~~~~~~~~~~
// - Client application filled out the header-information incorrectly.
//
// The trace-message shows both values (DataSize, DataBufferSize)


40  = "Message inconsistent: EDistLayerCInterfaceAccount::ConvertOseSignalToMsg: DataSize(={%1}) > DataBufferSize(={%2})","uu"
/////////////////////////////////////////////////////////////////////////////////////////////////////



/////////////// MESSAGE INCONSISTENT FAILURE 2 ////////////////////////////////////////////////
//
// Description: 
// ~~~~~~~~~~~~
// A DistributionLayer message object is created with contradictory configuration-data.
// The DistLayerMsg-object's data-area should be initialized with the data at a given address.
// The number of bytes to be copied from the source-data exceeds the actual available datasize
// within the DistLayerMsg-object's data-area with respect to the given offset within the 
// destination data area.
//
//  ---------------------
// |     SourceBuffer    |
// |---------------------|
// |                     |
// |  SourceBufferSize   | 
// |<------------------->|
//
//  -------------------------
// |     DestinationBuffer   |
// |-------------------------|
// |          |              |
// |  Offset  |              |
// |<-------->|              |
// |                         |
// |       DestDataSize      | 
// |<----------------------->|
//
// DataSize > DataBufferSize
//
// SourceBufferSize...number of bytes to be copied from a source-data buffer
// DestDataSize.......number of bytes available in the destination data buffer (DistLayerMsg-object's data area)
// Offset.............number of bytes to skip before inserting data
//
// Possible reasons: 
// ~~~~~~~~~~~~~~~~~
// - Wrong handling from within client's code.
//
// The trace-message shows all the discussed values (SourceBufferSize, Offset and DestDataSize)


41  = "Message inconsistent: EDistLayerMsg ctor: SourceBufferSize(={%1}) > (DestDataSize(={%2}) - Offset(={%3}))","uuu"
/////////////////////////////////////////////////////////////////////////////////////////////////////



/////////////// MESSAGE INCONSISTENT FAILURE 3 ////////////////////////////////////////////////
//
// Description: 
// ~~~~~~~~~~~~
// An EDistLayerMsg should be created, but the arguments provided to the constructor are 
// inconsistent.
// The user specified an offset within the data-area which exceeds the data-area's size.
//
//  -------------------------
// |     MessageData-Area    |     ???
// |-------------------------|     ???
// |                         |      |
// |         Offset          |      |
// |<------------------------------>|   
// |                         |
// |        DataSize         | 
// |<----------------------->|
//
// 
// Possible reasons: 
// ~~~~~~~~~~~~~~~~~
// - Wrong handling from within client's code.
//
// The trace-message shows all the discussed values (DataSize, Offset)


42  = "Message inconsistent: EDistLayerMsg ctor: DataSize(={%1}) =< Offset(={%2})","uu"
/////////////////////////////////////////////////////////////////////////////////////////////////////




/////////////// MESSAGE INCONSISTENT FAILURE 4 ////////////////////////////////////////////////
//
// Description: 
// ~~~~~~~~~~~~
// The client tries to define a valid data-length which would exceed the actual data buffer's size
//
//  -------------------------
// |     MessageData-Area    |     ???
// |-------------------------|     ???
// |                         |      |
// |       DataSize          |      |
// |<------------------------------>|   
// |                         |
// |     DataBufferSize      | 
// |<----------------------->|
//
// Possible reasons: 
// ~~~~~~~~~~~~~~~~~
// - Wrong handling from within client's code.
//
// The trace-message shows all the discussed values (DataSize, DataBufferSize)


43  = "Message inconsistent: EDistLayerMsg::SetDataSize: DataSize(={%1}) > DataBufferSize(={%2})","uu"
/////////////////////////////////////////////////////////////////////////////////////////////////////



/////////////// MEMORY ALLOCATION FAILURE ////////////////////////////////////////////////
//
// Description: 
// ~~~~~~~~~~~~
// A heap allocation failed (i.e. a NULL-pointer has been returned)
//
// Possible reasons: 
// ~~~~~~~~~~~~~~~~~
// - Memory leak
//
// The trace-message shows the method where the problem occured, the kind of element which
// was tried to be allocated, as well as the size.


50  = "Method '{%1}': Memory allocation failed when trying to allocate '{%2}'. (size:{%3} byte(s)).","ssu"
/////////////////////////////////////////////////////////////////////////////////////////////////////



/////////////// CLIENT APPLICATION FAILED TO SUBSCRIBE //////////////////////////////////////////
//
// Description: 
// ~~~~~~~~~~~~
// A client application failed to subscribe at the distribution layer for receiving a certain set
// of messages
//
// Possible reasons: 
// ~~~~~~~~~~~~~~~~~
// - Another subscription exists which stays in conflict with the requested one.
//
// Note: this error occurs in combination with a subscription conflict error which provides
//       a more detailed reason for the failed subscription.
//


60  = "Subscribe failed. ApplicationId:{%1} Board:{%2} IndividualRange:{%3}-{%4}","xxxx"
/////////////////////////////////////////////////////////////////////////////////////////////////////




/////////////// CLIENT APPLICATION FAILED TO UNSUBSCRIBE //////////////////////////////////////////
//
// Description: 
// ~~~~~~~~~~~~
// A client application failed to unsubscribe from the distribution layer for receiving a certain set
// of messages
//
// Possible reasons: 
// ~~~~~~~~~~~~~~~~~
// - No subscription with the provided data does exist.
//
// The same data as used in the subscription have to be used for unsubscribing, too.
//


70  = "Unsubscribe failed. ApplicationId:{%1} Board:{%2} IndividualRange:{%3}-{%4}","xxxx"
/////////////////////////////////////////////////////////////////////////////////////////////////////



///////////////////////////// SUBSCRIPTION CONFLICT 1 FAILURE //////////////////////////////////////////
//
// Description: 
// ~~~~~~~~~~~~
// The client tries to subscribe for ApplicationId/AnyBoard/AnyIndividual. This would mean all
// messages for the given ApplicationId, no matter which Board, no matter which Individual.
// The problem is, that there exists already at least one subscription for the given ApplicationId.
// As the addressing-scheme works in a hierarchy similar to IP-addressing format, the newly
// created subscription would also include the already existing one(s).
// The DistributionLayer does allow only one certain receiver.
//
// Possible reasons: 
// ~~~~~~~~~~~~~~~~~
// - User error
//
// The trace-message shows the configuration of the subscription to be added (=ApplicationId)
// 
// Hint: Look into the INFO-Trace. Each successfully created subscription will be reported there
//       together with all the subscription data
//


80  = "Subscription Conflict: There exists at least one subscription for ApplicationId:{%1}. This prevents from adding a Subscription with ApplicationId:{%1}/AnyBoard/AnyIndividual","x"
/////////////////////////////////////////////////////////////////////////////////////////////////////



///////////////////////////// SUBSCRIPTION CONFLICT 2 FAILURE //////////////////////////////////////////
//
// Description: 
// ~~~~~~~~~~~~
// The client tries to subscribe for a certain combination of ApplicationId/BoardId/(Individual(range)). 
// The problem is, that there exists a subscription for ApplicationId/AnyBoard/AnyIndividual.
// As the addressing-scheme works in a hierarchy similar to IP-addressing format, the existing
// subscription (AnyBoard) also covers the newly created one (BoardId).
// The DistributionLayer does allow only one certain receiver.
//
// Possible reasons: 
// ~~~~~~~~~~~~~~~~~
// - User error
//
// The trace-message shows the configuration of the subscription to be added (ApplicationId, Board, IndividualRange)
//
// Hint: Look into the INFO-Trace. Each successfully created subscription will be reported there
//       together with all the subscription data
// 


81  = "Subscription Conflict: There exists already a subscription with ApplicationId:{%1}/AnyBoard/AnyIndividual. This prevents from adding a Subscription with ApplicationId:{%1}/Board:{%2}/IndividualRange:{%3}-{%4}","xxxx"
/////////////////////////////////////////////////////////////////////////////////////////////////////



///////////////////////////// SUBSCRIPTION CONFLICT 3 FAILURE //////////////////////////////////////////
//
// Description: 
// ~~~~~~~~~~~~
// The client tries to subscribe for a certain combination of ApplicationId/BoardId/(Individual(range)). 
// The problem is, that there exists a subscription for ApplicationId/BoardId/AnyIndividual.
// As the addressing-scheme works in a hierarchy similar to IP-addressing format, the existing
// subscription (AnyIndividual) also covers the newly created one (Individual(range)).
// The DistributionLayer does allow only one certain receiver.
//
// Possible reasons: 
// ~~~~~~~~~~~~~~~~~
// - User error
//
// The trace-message shows the configuration of the subscription to be added (ApplicationId, Board, IndividualRange)
//
// Hint: Look into the INFO-Trace. Each successfully created subscription will be reported there
//       together with all the subscription data
// 


82  = "Subscription Conflict: There exists already a subscription with ApplicationId:{%1}/Board:{%2}/AnyIndividual. This prevents from adding a Subscription with ApplicationId:{%1}/Board:{%2}/IndividualRange:{%3}-{%4}","xxxx"
/////////////////////////////////////////////////////////////////////////////////////////////////////



///////////////////////////// INVALID BOARD POSITION FAILURE //////////////////////////////////////////
//
// Description: 
// ~~~~~~~~~~~~
// The client provided an invalid value as BoardPosition.
//
// Possible reasons: 
// ~~~~~~~~~~~~~~~~~
// - User error
//
// The trace-message shows the invalid value and the method it was provided to.
// 


90  = "Method {%1}: invalid BoardPosition:{%2}","sx"
/////////////////////////////////////////////////////////////////////////////////////////////////////







///////////////////////////// INVALID LOCAL BOARD POSITION MODIFICATION FAILURE //////////////////////
//
// Description: 
// ~~~~~~~~~~~~
// DistributionLayer needs to know the local board position. Assigning it may happen only once.
//
// Possible reasons: 
// ~~~~~~~~~~~~~~~~~
// - User tried to modify LocalBoardPosition after it has been set already.
//


100 = "Not allowed to change LocalBoardPosition (Current value:{%1}). May be set only once during startup.","x"
/////////////////////////////////////////////////////////////////////////////////////////////////////



///////////////////////////// INVALID LOCAL BOARD POSITION MODIFICATION FAILURE //////////////////////
//
// Description: 
// ~~~~~~~~~~~~
// for C++ -> C communication so called C-interface message mailboxes are used. For each subscribed client
// process such a mailbox will be created (allocated on the heap).
// If allocation of a C-interface message mailboxes fails, this error will be reported
//
// Possible reasons: 
// ~~~~~~~~~~~~~~~~~
// - distribution layer internal error
// - memory leak
//


110 = "EDistLayerCInterfaceMsgMailbox neither could be found nor created.",""
/////////////////////////////////////////////////////////////////////////////////////////////////////
