canaerometadata.h

00001 // Copyright (C) 2008,2009,2010 by Philipp Münzel. All rights reserved.
00002 // Released under the terms of the license described in license.txt
00003 
00004 #ifndef CANAEROMETADATA_H
00005 #define CANAEROMETADATA_H
00006 
00007 #include "dllexport.h"
00008 
00009 #include <ostream>
00010 #ifdef HAVE_TR1
00011 #include <tr1/cstdint>
00012 #else
00013 #include <stdint.h>
00014 #endif
00015 
00016 #include "canaerofunctions.h"
00017 #include "log.h"
00018 
00019 namespace SCS {
00020 
00033 class DLL_PUBLIC CanAeroMetadata
00034 {
00035 public:
00036 
00042     CanAeroMetadata(can_Id_t can_id, uint8_t node_id = SCS_NODE_ID);
00043 
00047     can_Id_t id() const;
00048 
00052     AS_IDwidth isId29() const;
00053 
00058     uint8_t increaseMessageCode() const;
00059 
00067     bool checkMessageCode(uint8_t new_code) const;
00068 
00072     uint8_t nodeId() const;
00073 
00078     void setNodeId(uint8_t node_id) const;
00079 
00084     bool operator<(const CanAeroMetadata& rhs) const;
00085 
00086 private:
00087     mutable uint8_t m_node_id;  
00088     can_Id_t    m_can_id;   
00089     mutable uint8_t m_message_code; 
00090 };
00091 
00092 }
00093 
00094 std::ostream& operator<< (std::ostream& out, const SCS::CanAeroMetadata& meta);
00095 SCS::Log& operator<< (SCS::Log& out, const SCS::CanAeroMetadata& meta);
00096 
00097 #endif // CANAEROMETADATA_H