OpFlex Framework  1.3.0
InspectorClient.h
Go to the documentation of this file.
1 /* -*- C++ -*-; c-basic-offset: 4; indent-tabs-mode: nil */
6 /*
7  * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
8  *
9  * This program and the accompanying materials are made available under the
10  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
11  * and is available at http://www.eclipse.org/legal/epl-v10.html
12  */
13 
14 #ifndef OFCORE_INSPECTORCLIENT_H
15 #define OFCORE_INSPECTORCLIENT_H
16 
17 #include <string>
18 #include <boost/noncopyable.hpp>
19 
20 #include "opflex/modb/URI.h"
22 
23 namespace opflex {
24 namespace ofcore {
25 
44 class InspectorClient : private boost::noncopyable {
45 public:
49  virtual ~InspectorClient() {}
50 
57  static InspectorClient* newInstance(const std::string& name,
58  const modb::ModelMetadata& model);
59 
65  virtual void setFollowRefs(bool enabled) = 0;
66 
73  virtual void setRecursive(bool enabled) = 0;
74 
81  virtual void addQuery(const std::string& subject,
82  const modb::URI& uri) = 0;
83 
89  virtual void addClassQuery(const std::string& subject) = 0;
90 
94  virtual void execute() = 0;
95 
102  virtual void dumpToFile(FILE* file) = 0;
103 
111  virtual size_t loadFromFile(FILE* file) = 0;
112 
121  virtual void prettyPrint(std::ostream& output,
122  bool tree = true,
123  bool includeProps = true,
124  bool utf8 = true) = 0;
125 };
126 
130 } /* namespace ofcore */
131 } /* namespace opflex */
132 
133 #endif /* OFCORE_INSPECTORCLIENT_H */
Interface definition file for ModelMetadata.
virtual void execute()=0
Attempt to execute all queued inspector commands.
virtual void addQuery(const std::string &subject, const modb::URI &uri)=0
Query for a particular managed object.
Inspect the state of a a managed object database using the inspector protocol.
Definition: InspectorClient.h:44
virtual void dumpToFile(FILE *file)=0
Dump the current MODB view to the specified file using the Opflex JSON wire format.
virtual void setFollowRefs(bool enabled)=0
Follow references for retrieved objects.
virtual void setRecursive(bool enabled)=0
Download the whole subtree rather than just the specific object for each query.
A URI is used to identify managed objects in the MODB.
Definition: URI.h:41
static InspectorClient * newInstance(const std::string &name, const modb::ModelMetadata &model)
Allocate a new inspector client for the given socket name.
Model metadata encapsulated all the metadata for a given model.
Definition: ModelMetadata.h:47
Interface definition file for URIs.
virtual void prettyPrint(std::ostream &output, bool tree=true, bool includeProps=true, bool utf8=true)=0
Pretty print the current MODB to the provided output stream.
virtual void addClassQuery(const std::string &subject)=0
Query for all managed objects of a particular type.
virtual ~InspectorClient()
Destroy the inspector client.
Definition: InspectorClient.h:49
virtual size_t loadFromFile(FILE *file)=0
Load a set of managed objects from the given file into the inspector's MODB view in order to display ...