Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cdo
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
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
mpim-sw
cdo
Commits
ac787674
Commit
ac787674
authored
2 years ago
by
Oliver Heidmann
Browse files
Options
Downloads
Patches
Plain Diff
removed exception definition form node.h, added errmesage strings
parent
3186ef71
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!26
parser cleanup and fixes
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/node.cc
+6
-5
6 additions, 5 deletions
src/node.cc
src/node.h
+6
-9
6 additions, 9 deletions
src/node.h
with
12 additions
and
14 deletions
src/node.cc
+
6
−
5
View file @
ac787674
#include
"node.h"
#include
"cdo_output.h"
#include
"cdo_node_attach_exception.h"
Node
::
Node
(
std
::
vector
<
std
::
string
>::
const_iterator
p_iter
,
const
std
::
string
&
p_oper
,
const
std
::
string
&
args
,
...
...
@@ -48,21 +49,21 @@ Node::append(std::shared_ptr<Node> &node)
{
Debug
(
CDO_NODE
,
"appending %s to %s"
,
node
->
oper
,
oper
);
if
(
isFile
&&
!
isOutFile
&&
node
->
isFile
)
{
throw
NodeAttachException
(
node
,
"File to File not allowed"
);
}
if
(
isOutFile
&&
is_done
())
{
throw
NodeAttachException
(
node
,
"Could not be assigned, leftover input"
);
}
if
(
isFile
&&
!
isOutFile
&&
node
->
isFile
)
{
throw
NodeAttachException
(
node
,
errmsg_node_file_to_file
);
}
if
(
isOutFile
&&
is_done
())
{
throw
NodeAttachException
(
node
,
errmsg_node_unassigned
);
}
if
(
constraints
.
streamInCnt
>=
0
&&
(
int
)
children
.
size
()
==
constraints
.
streamInCnt
)
{
throw
NodeAttachException
(
iter
,
"To
many
inputs
"
);
throw
NodeAttachException
(
iter
,
errmsg_node_to_
many
_
inputs
);
}
if
(
node
->
numOut
()
==
0
)
{
throw
NodeAttachException
(
node
,
"operator has no output, cannot be used with pipes unless used first"
);
throw
NodeAttachException
(
node
,
errmsg_node_no_output
);
}
if
(
get_restriction
()
==
PositionRestrictions
::
FilesOnly
&&
!
node
->
isFile
)
{
size_t
start
=
((
*
iter
)[
0
]
==
'-'
)
?
1
:
0
;
std
::
string
name
=
(
*
iter
).
substr
(
start
,
(
*
iter
).
size
()
-
0
);
throw
NodeAttachException
(
node
,
"This Operator cannot be piped into an operator that takes only files <"
+
name
+
">"
);
throw
NodeAttachException
(
node
,
errmsg_node_only_accepts_files
);
}
children
.
push_back
(
node
);
}
...
...
This diff is collapsed.
Click to expand it.
src/node.h
+
6
−
9
View file @
ac787674
...
...
@@ -7,6 +7,12 @@
#include
<iostream>
#include
"modules.h"
static
std
::
string
errmsg_node_to_many_inputs
=
"To many inputs"
;
static
std
::
string
errmsg_node_no_output
=
"Operator has no output, cannot be used with pipes unless used first"
;
static
std
::
string
errmsg_node_unassigned
=
"Could not be assigned, leftover input"
;
static
std
::
string
errmsg_node_file_to_file
=
"Attempted to attach file to file"
;
static
std
::
string
errmsg_node_only_accepts_files
=
"Operator cannot be piped into an operator that takes only files"
;
class
Node
{
public:
...
...
@@ -54,14 +60,5 @@ public:
std
::
string
to_string
();
};
struct
NodeAttachException
:
public
std
::
invalid_argument
{
std
::
vector
<
std
::
string
>::
const_iterator
iter
;
NodeAttachException
(
std
::
shared_ptr
<
Node
>
p_node
,
const
std
::
string
&
p_msg
)
:
std
::
invalid_argument
(
p_msg
),
iter
(
p_node
->
iter
){};
NodeAttachException
(
std
::
vector
<
std
::
string
>::
const_iterator
p_iter
,
const
std
::
string
&
p_msg
)
:
std
::
invalid_argument
(
p_msg
),
iter
(
p_iter
){};
};
#endif
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