OpFlex Framework 1.7.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
23namespace opflex {
24namespace ofcore {
25
32
44class InspectorClient : private boost::noncopyable {
45public:
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
123 virtual void prettyPrint(std::ostream& output,
124 bool tree = true,
125 bool includeProps = true,
126 bool utf8 = true,
127 size_t truncate = 0) = 0;
128};
129
132
133} /* namespace ofcore */
134} /* namespace opflex */
135
136#endif /* OFCORE_INSPECTORCLIENT_H */
Interface definition file for ModelMetadata.
Interface definition file for URIs.
Model metadata encapsulated all the metadata for a given model.
Definition ModelMetadata.h:47
A URI is used to identify managed objects in the MODB.
Definition URI.h:43
Inspect the state of a a managed object database using the inspector protocol.
Definition InspectorClient.h:44
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 ...
virtual void setRecursive(bool enabled)=0
Download the whole subtree rather than just the specific object for each query.
virtual void execute()=0
Attempt to execute all queued inspector commands.
virtual void addClassQuery(const std::string &subject)=0
Query for all managed objects of a particular type.
virtual void setFollowRefs(bool enabled)=0
Follow references for retrieved objects.
virtual void addQuery(const std::string &subject, const modb::URI &uri)=0
Query for a particular managed object.
virtual void prettyPrint(std::ostream &output, bool tree=true, bool includeProps=true, bool utf8=true, size_t truncate=0)=0
Pretty print the current MODB to the provided output stream.
virtual void dumpToFile(FILE *file)=0
Dump the current MODB view to the specified file using the Opflex JSON wire format.
virtual ~InspectorClient()
Destroy the inspector client.
Definition InspectorClient.h:49
static InspectorClient * newInstance(const std::string &name, const modb::ModelMetadata &model)
Allocate a new inspector client for the given socket name.