| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- /*
- * Copyright (C) 2007-2011 Siemens AG
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- /*******************************************************************
- *
- * @author Daniel.Peintner.EXT@siemens.com
- * @version 2011-12-02
- * @contact Joerg.Heuer@siemens.com
- *
- * <p>Code generated by EXIdizer</p>
- ********************************************************************/
- #include "EncoderChannel.h"
- #include "CoderChannel.h"
- #include "BitOutputStream.h"
- #include "EXITypes.h"
- #ifndef BIT_ENCODER_CHANNEL_C
- #define BIT_ENCODER_CHANNEL_C
- #if EXI_ALIGNMENT == BIT_PACKED
- int encode(bitstream_t* stream, uint8_t b) {
- return writeBits(stream, 8, b);
- }
- /**
- * Encode a single boolean value. A false value is encoded as bit 0 and true
- * value is encode as bit 1.
- */
- int encodeBoolean(bitstream_t* stream, int b) {
- uint8_t val = b ? 1 : 0;
- return writeBits(stream, 1, val);
- }
- /**
- * Encode n-bit unsigned integer. The n least significant bits of parameter
- * b starting with the most significant, i.e. from left to right.
- */
- int encodeNBitUnsignedInteger(bitstream_t* stream, uint16_t nbits, uint32_t val) {
- if (nbits > 0) {
- return writeBits(stream, nbits, val);
- }
- return 0;
- }
- /**
- * Flush underlying bit output stream.
- */
- int encodeFinish(bitstream_t* stream) {
- return flush(stream);
- }
- #endif /* alignment */
- #endif
|