Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F27036854
types.hpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
types.hpp
View Options
/*******************************************************************************
*
* File: types.hpp
*
* Contents: Facility for type-related things
*
* Copyright 2016
*
* Author: David Juhasz (david.juhasz@tuwien.ac.at)
*
******************************************************************************/
#ifndef ROSA_SUPPORT_TYPES_HPP
#define ROSA_SUPPORT_TYPES_HPP
#include
<cstdint>
namespace
rosa
{
// A value of type [u]int8_t is treated as a character when being put to an
// output stream, which can result in invisible characters being printed. To
// avoid that, such a value needs to be casted to a wider type. It can be done
// by using the following template to find a target type to cast our value to.
// NOTE: There is a preprocessor macro below which can be used instead of the
// tedious typename stuff.
template
<
typename
T
>
struct
PrintableType
{
typedef
T
type
;
};
template
<>
struct
PrintableType
<
uint8_t
>
{
typedef
unsigned
int
type
;
};
template
<>
struct
PrintableType
<
int8_t
>
{
typedef
int
type
;
};
#define PRINTABLE(T) typename PrintableType<T>::type
}
// End namespace rosa
#endif
// ROSA_SUPPORT_TYPES_HPP
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Tue, Oct 27, 8:15 PM (1 d, 10 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
410262
Default Alt Text
types.hpp (1 KB)
Attached To
Mode
R20 SoC_Rosa_repo
Attached
Detach File
Event Timeline