Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Karsten Rink
ogs
Commits
36835f89
Commit
36835f89
authored
4 years ago
by
Tom Fischer
Committed by
Dmitri Naumov
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[MeL] Properties: Remove unnecessary c_str().
parent
729ef873
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MeshLib/Properties-impl.h
+14
-16
14 additions, 16 deletions
MeshLib/Properties-impl.h
MeshLib/Properties.cpp
+1
-1
1 addition, 1 deletion
MeshLib/Properties.cpp
with
15 additions
and
17 deletions
MeshLib/Properties-impl.h
+
14
−
16
View file @
36835f89
...
...
@@ -21,7 +21,7 @@ PropertyVector<T>* Properties::createNewPropertyVector(
);
if
(
it
!=
_properties
.
end
())
{
ERR
(
"A property of the name '{:s}' is already assigned to the mesh."
,
name
.
c_str
()
);
name
);
return
nullptr
;
}
auto
entry_info
(
...
...
@@ -49,7 +49,7 @@ PropertyVector<T>* Properties::createNewPropertyVector(
);
if
(
it
!=
_properties
.
end
())
{
ERR
(
"A property of the name '{:s}' already assigned to the mesh."
,
name
.
c_str
()
);
name
);
return
nullptr
;
}
...
...
@@ -124,14 +124,14 @@ PropertyVector<T> const* Properties::getPropertyVector(
if
(
it
==
_properties
.
end
())
{
OGS_FATAL
(
"The PropertyVector '{:s}' is not available in the mesh."
,
name
.
c_str
()
);
name
);
}
if
(
!
dynamic_cast
<
PropertyVector
<
T
>
const
*>
(
it
->
second
))
{
OGS_FATAL
(
"The PropertyVector '{:s}' has a different type than the requested "
"PropertyVector."
,
name
.
c_str
()
);
name
);
}
return
dynamic_cast
<
PropertyVector
<
T
>
const
*>
(
it
->
second
);
}
...
...
@@ -144,14 +144,14 @@ PropertyVector<T>* Properties::getPropertyVector(std::string const& name)
{
OGS_FATAL
(
"A PropertyVector with the specified name '{:s}' is not available."
,
name
.
c_str
()
);
name
);
}
if
(
!
dynamic_cast
<
PropertyVector
<
T
>*>
(
it
->
second
))
{
OGS_FATAL
(
"The PropertyVector '{:s}' has a different type than the requested "
"PropertyVector."
,
name
.
c_str
()
);
name
);
}
return
dynamic_cast
<
PropertyVector
<
T
>*>
(
it
->
second
);
}
...
...
@@ -166,7 +166,7 @@ PropertyVector<T> const* Properties::getPropertyVector(
{
OGS_FATAL
(
"A PropertyVector with name '{:s}' does not exist in the mesh."
,
name
.
c_str
()
);
name
);
}
auto
property
=
dynamic_cast
<
PropertyVector
<
T
>*>
(
it
->
second
);
...
...
@@ -175,22 +175,21 @@ PropertyVector<T> const* Properties::getPropertyVector(
OGS_FATAL
(
"Could not cast the data type of the PropertyVector '{:s}' to "
"requested data type."
,
name
.
c_str
()
);
name
);
}
if
(
property
->
getMeshItemType
()
!=
item_type
)
{
OGS_FATAL
(
"The PropertyVector '{:s}' has type '{:s}'. A '{:s}' field is "
"requested."
,
name
.
c_str
(),
toString
(
property
->
getMeshItemType
()),
toString
(
item_type
));
name
,
toString
(
property
->
getMeshItemType
()),
toString
(
item_type
));
}
if
(
property
->
getNumberOfComponents
()
!=
n_components
)
{
OGS_FATAL
(
"PropertyVector '{:s}' has {:d} components, {:d} components are "
"needed."
,
name
.
c_str
()
,
property
->
getNumberOfComponents
(),
n_components
);
name
,
property
->
getNumberOfComponents
(),
n_components
);
}
return
property
;
}
...
...
@@ -205,7 +204,7 @@ PropertyVector<T>* Properties::getPropertyVector(std::string const& name,
{
OGS_FATAL
(
"A PropertyVector with name '{:s}' does not exist in the mesh."
,
name
.
c_str
()
);
name
);
}
auto
property
=
dynamic_cast
<
PropertyVector
<
T
>*>
(
it
->
second
);
...
...
@@ -214,22 +213,21 @@ PropertyVector<T>* Properties::getPropertyVector(std::string const& name,
OGS_FATAL
(
"Could not cast the data type of the PropertyVector '{:s}' to "
"requested data type."
,
name
.
c_str
()
);
name
);
}
if
(
property
->
getMeshItemType
()
!=
item_type
)
{
OGS_FATAL
(
"The PropertyVector '{:s}' has type '{:s}'. A '{:s}' field is "
"requested."
,
name
.
c_str
(),
toString
(
property
->
getMeshItemType
()),
toString
(
item_type
));
name
,
toString
(
property
->
getMeshItemType
()),
toString
(
item_type
));
}
if
(
property
->
getNumberOfComponents
()
!=
n_components
)
{
OGS_FATAL
(
"PropertyVector '{:s}' has {:d} components, {:d} components are "
"needed."
,
name
.
c_str
()
,
property
->
getNumberOfComponents
(),
n_components
);
name
,
property
->
getNumberOfComponents
(),
n_components
);
}
return
property
;
}
This diff is collapsed.
Click to expand it.
MeshLib/Properties.cpp
+
1
−
1
View file @
36835f89
...
...
@@ -21,7 +21,7 @@ void Properties::removePropertyVector(std::string const& name)
_properties
.
find
(
name
)
);
if
(
it
==
_properties
.
end
())
{
WARN
(
"A property of the name '{:s}' does not exist."
,
name
.
c_str
()
);
WARN
(
"A property of the name '{:s}' does not exist."
,
name
);
return
;
}
delete
it
->
second
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment