Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Damir Mustafin
lo3
Commits
9ff862dc
Commit
9ff862dc
authored
Dec 27, 2019
by
Matvey Masych
Browse files
minor code style refactoring on df.h file
parent
0057cacf
Changes
1
Hide whitespace changes
Inline
Side-by-side
include/df.h
View file @
9ff862dc
...
...
@@ -91,11 +91,11 @@ protected:
// Compatibility members
public:
template
<
class
T
>
const
T
*
getData
()
const
const
T
*
getData
()
const
{
assert
(
size_
%
sizeof
(
T
)
==
0
);
return
static_cast
<
const
T
*>
(
get_data
());
return
static_cast
<
const
T
*>
(
get_data
());
}
std
::
string
getName
()
const
;
...
...
@@ -123,11 +123,11 @@ public:
}
template
<
class
T
>
T
*
getData
()
T
*
getData
()
{
assert
(
size_
%
sizeof
(
T
)
==
0
);
return
static_cast
<
T
*>
(
get_data
());
return
static_cast
<
T
*>
(
get_data
());
}
template
<
class
T
>
...
...
@@ -137,8 +137,8 @@ public:
||
std
::
is_same
<
T
,
std
::
string
>::
value
)
{
*
this
=
val
;
}
else
{
ABORT
(
"Unsupported type in setValue: "
+
std
::
string
(
typeid
(
T
).
name
()))
ABORT
(
"Unsupported type in setValue: "
+
std
::
string
(
typeid
(
T
).
name
()))
}
}
...
...
@@ -147,16 +147,16 @@ public:
{
if
(
std
::
is_same
<
T
,
int
>::
value
)
{
if
(
type_
!=
TYPE_INT
)
{
ABORT
(
"not an int: "
+
to_string
());
ABORT
(
"not an int: "
+
to_string
());
}
return
*
static_cast
<
const
T
*>
(
ptr_
);
return
*
static_cast
<
const
T
*>
(
ptr_
);
}
else
if
(
std
::
is_same
<
T
,
double
>::
value
)
{
if
(
type_
!=
TYPE_REAL
)
{
ABORT
(
"not a real: "
+
to_string
());
ABORT
(
"not a real: "
+
to_string
());
}
return
*
static_cast
<
const
T
*>
(
ptr_
);
return
*
static_cast
<
const
T
*>
(
ptr_
);
}
else
{
ABORT
(
"getValue<"
+
std
::
string
(
typeid
(
T
).
name
())
+
">() failed for "
+
to_string
());
ABORT
(
"getValue<"
+
std
::
string
(
typeid
(
T
).
name
())
+
">() failed for "
+
to_string
());
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment