EncoderChannel.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. /*
  2. * Copyright (C) 2007-2011 Siemens AG
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU Lesser General Public License as published
  6. * by the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU Lesser General Public License for more details.
  13. * GNU Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /*******************************************************************
  19. *
  20. * @author Daniel.Peintner.EXT@siemens.com
  21. * @version 2011-12-02
  22. * @contact Joerg.Heuer@siemens.com
  23. *
  24. * <p>Code generated by EXIdizer</p>
  25. ********************************************************************/
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. #include "EXITypes.h"
  30. #ifndef ENCODER_CHANNEL_H
  31. #define ENCODER_CHANNEL_H
  32. /**
  33. * Encode a byte value.
  34. */
  35. int encode(bitstream_t* stream, uint8_t b);
  36. /**
  37. * Encode a single boolean value. A false value is encoded as 0 and true
  38. * value is encode as 1.
  39. */
  40. int encodeBoolean(bitstream_t* stream, int b);
  41. /**
  42. * Encode n-bit unsigned integer. The n least significant bits of parameter
  43. * b starting with the most significant, i.e. from left to right.
  44. */
  45. int encodeNBitUnsignedInteger(bitstream_t* stream, uint16_t nbits, uint32_t val);
  46. /**
  47. * Encode an arbitrary precision non negative integer using a sequence of
  48. * octets. The most significant bit of the last octet is set to zero to
  49. * indicate sequence termination. Only seven bits per octet are used to
  50. * store the integer's value.
  51. */
  52. int encodeUnsignedInteger(bitstream_t* stream, integer_t* iv);
  53. /**
  54. * Encode an arbitrary precision non negative integer using a sequence of
  55. * octets. The most significant bit of the last octet is set to zero to
  56. * indicate sequence termination. Only seven bits per octet are used to
  57. * store the integer's value.
  58. */
  59. int encodeUnsignedInteger32(bitstream_t* stream, uint32_t n);
  60. /**
  61. * Encode an arbitrary precision non negative integer using a sequence of
  62. * octets. The most significant bit of the last octet is set to zero to
  63. * indicate sequence termination. Only seven bits per octet are used to
  64. * store the integer's value.
  65. */
  66. int encodeUnsignedInteger64(bitstream_t* stream, uint64_t n);
  67. /**
  68. * Encode an arbitrary precision integer using a sign boolean followed by a
  69. * sequence of octets. The most significant bit of the last octet is set to
  70. * zero to indicate sequence termination. Only seven bits per octet are used
  71. * to store the integer's value.
  72. */
  73. int encodeInteger(bitstream_t* stream, integer_t* iv);
  74. /**
  75. * Encode an arbitrary precision integer using a sign boolean followed by a
  76. * sequence of octets. The most significant bit of the last octet is set to
  77. * zero to indicate sequence termination. Only seven bits per octet are used
  78. * to store the integer's value.
  79. */
  80. int encodeInteger32(bitstream_t* stream, int32_t n);
  81. /**
  82. * Encode an arbitrary precision integer using a sign bit followed by a
  83. * sequence of octets. The most significant bit of the last octet is set to
  84. * zero to indicate sequence termination. Only seven bits per octet are used
  85. * to store the integer's value.
  86. */
  87. int encodeInteger64(bitstream_t* stream, int64_t n);
  88. /**
  89. * Encode a Float datatype as two consecutive Integers.
  90. * The first Integer represents the mantissa of the floating point
  91. * number and the second Integer represents the base-10 exponent
  92. * of the floating point number.
  93. */
  94. int encodeFloat(bitstream_t* stream, float_me_t* f);
  95. /**
  96. * Encode a decimal represented as a Boolean sign followed by two Unsigned
  97. * Integers. A sign value of zero (0) is used to represent positive Decimal
  98. * values and a sign value of one (1) is used to represent negative Decimal
  99. * values The first Integer represents the integral portion of the Decimal
  100. * value. The second positive integer represents the fractional portion of
  101. * the decimal with the digits in reverse order to preserve leading zeros.
  102. */
  103. int encodeDecimal(bitstream_t* stream, decimal_t* d);
  104. /**
  105. * Encode a length prefixed sequence of characters.
  106. */
  107. int encodeString(bitstream_t* stream, string_ucs_t* string);
  108. int encodeASCII(bitstream_t* stream, const char* ascii);
  109. /**
  110. * Encode a length prefixed sequence of characters in the sense of string tables
  111. */
  112. int encodeStringValue(bitstream_t* stream, string_ucs_t* string);
  113. /**
  114. * Restricted character set
  115. */
  116. int encodeRCSStringValue(bitstream_t* stream, rcs_t* rcs, string_ucs_t* string);
  117. /**
  118. * Encode a sequence of characters according to a given length.
  119. * Each character is represented by its UCS [ISO/IEC 10646]
  120. * code point encoded as an Unsigned Integer
  121. */
  122. int encodeUCSCharacters(bitstream_t* stream, uint32_t* chars, uint16_t len);
  123. int encodeASCIICharacters(bitstream_t* stream, const char* chars, uint16_t len);
  124. /**
  125. * Encode a binary value as a length-prefixed sequence of octets.
  126. */
  127. int encodeBinary(bitstream_t* stream, bytes_t* bytes);
  128. /**
  129. * Encode a datetime representation which is a sequence of values
  130. * representing the individual components of the Date-Time
  131. */
  132. int encodeDateTime(bitstream_t* stream, datetime_t* datetime);
  133. /**
  134. * Flush underlying bit output stream
  135. */
  136. int encodeFinish(bitstream_t* stream);
  137. #endif
  138. #ifdef __cplusplus
  139. }
  140. #endif