/* ========================= eCAL LICENSE =================================
 *
 * Copyright (C) 2016 - 2019 Continental Corporation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * ========================= eCAL LICENSE =================================
*/

syntax = "proto3";

import "ecal/core/pb/host.proto";
import "ecal/core/pb/process.proto";
import "ecal/core/pb/service.proto";
import "ecal/core/pb/topic.proto";

package eCAL.pb;

message Content                                // topic content
{
  int64        id                    =  1;     // sample id
  int64        clock                 =  2;     // internal used clock
  int64        time                  =  3;     // time the content was updated
  bytes        payload               =  4;     // octet stream
  int32        size                  =  6;     // size (redundant for compatibility)
  int64        hash                  =  7;     // unique hash for that sample
}

enum eCmdType                                  // command type
{
  bct_none             =  0;                   // undefined command
  bct_set_sample       =  1;                   // set sample content
  bct_reg_publisher    =  2;                   // register publisher
  bct_reg_subscriber   =  3;                   // register subscriber
  bct_reg_process      =  4;                   // register process
  bct_reg_service      =  5;                   // register service
  bct_reg_client       =  6;                   // register client

  bct_unreg_publisher  = 12;                   // unregister publisher
  bct_unreg_subscriber = 13;                   // unregister subscriber
  bct_unreg_process    = 14;                   // unregister process
  bct_unreg_service    = 15;                   // unregister service
  bct_unreg_client     = 16;                   // unregister client
}

message Sample                                 // a sample is a topic, it's descriptions and it's content
{
  eCmdType     cmd_type              =  1;     // sample command type
  Host         host                  =  2;     // host information
  Process      process               =  3;     // process information
  Service      service               =  4;     // service information
  Client       client                =  7;     // client information
  Topic        topic                 =  5;     // topic information
  Content      content               =  6;     // topic content
  bytes        padding               =  8;     // padding to artificially increase the size of the message. This is a workaround for TCP topics, to get the actual user-payload 8-byte-aligned. REMOVE ME IN ECAL6
}

message SampleList
{
  repeated Sample samples = 1;
}
