summaryrefslogtreecommitdiffstats
path: root/staptree.h
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2009-10-13 16:57:38 -0700
committerJosh Stone <jistone@redhat.com>2009-10-13 16:57:38 -0700
commitd5e178c1d6eb0e7c1a317b925687050aa1cb6c1b (patch)
tree0d46cafccc4518b81b6462b59333dca0fe5eca63 /staptree.h
parent42b2e52658603d3e1384a909ad816d05529fc1d3 (diff)
downloadsystemtap-steved-d5e178c1d6eb0e7c1a317b925687050aa1cb6c1b.tar.gz
systemtap-steved-d5e178c1d6eb0e7c1a317b925687050aa1cb6c1b.tar.xz
systemtap-steved-d5e178c1d6eb0e7c1a317b925687050aa1cb6c1b.zip
Consolidate print_format creation
We almost had a factory in print_format::parse_print, so let's take that the rest of the way. This way we don't have so much duplication in initializing the print flags. * staptree.cxx (print_format::parse_print): Replaced with... (print_format::create): New factory to parse and create print_formats. * elaborate.cxx (add_global_var_display): Use this factory. * parse.cxx (parser::parse_symbol): Ditto. * tapset-mark.cxx (mark_var_expanding_visitor::visit_target_symbol_context): Ditto. * tapset-utrace.cxx (utrace_var_expanding_visitor::visit_target_symbol_arg): Ditto. * tapsets.cxx (dwarf_var_expanding_visitor::visit_target_symbol_context): Ditto. (tracepoint_var_expanding_visitor::visit_target_symbol_context) Ditto.
Diffstat (limited to 'staptree.h')
-rw-r--r--staptree.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/staptree.h b/staptree.h
index de148ce0..791b56f4 100644
--- a/staptree.h
+++ b/staptree.h
@@ -373,10 +373,6 @@ struct print_format: public expression
}
};
- print_format()
- : hist(NULL)
- {}
-
std::string raw_components;
std::vector<format_component> components;
format_component delimiter;
@@ -385,11 +381,17 @@ struct print_format: public expression
static std::string components_to_string(std::vector<format_component> const & components);
static std::vector<format_component> string_to_components(std::string const & str);
- static bool parse_print(const std::string &name, bool &stream,
- bool &format, bool &delim, bool &newline, bool &_char);
+ static print_format* create(const token *t);
void print (std::ostream& o) const;
void visit (visitor* u);
+
+private:
+ print_format(bool stream, bool format, bool delim, bool newline, bool _char):
+ print_to_stream(stream), print_with_format(format),
+ print_with_delim(delim), print_with_newline(newline),
+ print_char(_char), hist(NULL)
+ {}
};