Program Listing for File TypeObjectHashId.h

Return to documentation for file (/tmp/ws/src/fastrtps/include/fastrtps/types/TypeObjectHashId.h)

// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// 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.

#ifndef _TYPEOBJECTHASHID_H_
#define _TYPEOBJECTHASHID_H_

#include <fastrtps/types/TypesBase.h>
#include <stdint.h>
#include <array>
#include <string>
#include <vector>

namespace eprosima
{
    namespace fastcdr
    {
        class Cdr;
    }
}

// The types in this file shall be serialized with XCDR encoding version 2
namespace eprosima {
namespace fastrtps {

namespace types {

// First 14 bytes of MD5 of the serialized TypeObject using XCDR
// version 2 with Little Endian encoding
typedef octet EquivalenceHash[14];

class TypeObjectHashId
{
public:

    TypeObjectHashId();

    ~TypeObjectHashId();

    TypeObjectHashId(const TypeObjectHashId &x);

    TypeObjectHashId(TypeObjectHashId &&x);

    TypeObjectHashId& operator=(const TypeObjectHashId &x);

    TypeObjectHashId& operator=(TypeObjectHashId &&x);

    void _d(uint8_t __d);

    uint8_t _d() const;

    uint8_t& _d();

    void hash(const EquivalenceHash &_hash);

    void hash(EquivalenceHash &&_hash);

    const EquivalenceHash& hash() const;

    EquivalenceHash& hash();

    static size_t getCdrSerializedSize(const TypeObjectHashId& data, size_t current_alignment = 0);


    void serialize(eprosima::fastcdr::Cdr &cdr) const;

    void deserialize(eprosima::fastcdr::Cdr &cdr);



    static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0);

    static bool isKeyDefined();

    void serializeKey(eprosima::fastcdr::Cdr &cdr) const;

private:
    uint8_t m__d;

    EquivalenceHash m_hash;
};

} // namespace types
} // namespace fastrtps
} // namespace eprosima

#endif // _TYPEOBJECTHASHID_H_