MADARA
3.1.8
Main Page
Namespaces
Classes
Files
File List
File Members
Files.h
Go to the documentation of this file.
1
#ifndef _MADARA_KNOWLEDGE_BASE_FILES_H_
2
#define _MADARA_KNOWLEDGE_BASE_FILES_H_
3
11
#include <string>
12
#include "ace/Mem_Map.h"
13
#include "
madara/knowledge/ThreadSafeContext.h
"
14
#include "madara/MADARA_export.h"
15
16
namespace
madara
17
{
18
namespace
knowledge
19
{
24
class
Files
25
{
26
public
:
31
Files
(
ThreadSafeContext
& map);
32
38
MADARA_Export
int
read_file
(
const
std::string
& knowledge_key,
39
const
std::string
& filename);
40
47
MADARA_Export
int
read_file
(
const
char
* filename, ACE_Mem_Map & mem_map);
48
54
MADARA_Export ssize_t
write_file
(
const
std::string
& knowledge_key,
55
const
std::string
& filename);
56
64
MADARA_Export ssize_t
write_file
(
const
char
* filename,
65
void
*& buffer,
size_t
& size);
66
67
73
MADARA_Export
int
read_policy
(
const
std::string
& policy_key,
74
const
std::string
& policy_file);
75
82
MADARA_Export
int
shape_file
(
const
std::string
& source_key,
83
const
std::string
& target_key,
84
const
std::string
& policy_key);
85
86
private
:
87
// folder to store files into
88
const
static
std::string
files_folder_
;
89
90
// folder to store policies into
91
const
static
std::string
policies_folder_
;
92
93
// handle to the knowledge base
94
ThreadSafeContext
&
map_
;
95
};
96
}
97
}
98
99
#endif
madara::knowledge::Files::map_
ThreadSafeContext & map_
Definition:
Files.h:94
madara::knowledge::Files::files_folder_
static const std::string files_folder_
Definition:
Files.h:88
madara::knowledge::Files::read_policy
MADARA_Export int read_policy(const std::string &policy_key, const std::string &policy_file)
Read a policy into the knowledge base.
Definition:
Files.cpp:207
madara::knowledge::Files::policies_folder_
static const std::string policies_folder_
Definition:
Files.h:91
madara::knowledge::Files::shape_file
MADARA_Export int shape_file(const std::string &source_key, const std::string &target_key, const std::string &policy_key)
Shape a file according to a shaping policy.
Definition:
Files.cpp:21
madara::knowledge::Files::read_file
MADARA_Export int read_file(const std::string &knowledge_key, const std::string &filename)
Read a file into the knowledge base.
Definition:
Files.cpp:43
madara::knowledge::Files
This class provides file repo capabilities to the knowledge base.
Definition:
Files.h:24
ThreadSafeContext.h
madara::knowledge::ThreadSafeContext
This class stores variables and their values for use by any entity needing state information in a thr...
Definition:
ThreadSafeContext.h:82
madara::knowledge::Files::Files
Files(ThreadSafeContext &map)
Constructor.
Definition:
Files.cpp:14
madara::knowledge::Files::write_file
MADARA_Export ssize_t write_file(const std::string &knowledge_key, const std::string &filename)
Write a file from the knowledge base to a specified location.
Definition:
Files.cpp:111
madara::knowledge::tags::string
static constexpr struct madara::knowledge::tags::string_t string
madara::knowledge
Provides functions and classes for the distributed knowledge base.
Definition:
AggregateFilter.h:32
madara
Copyright (c) 2015 Carnegie Mellon University.
Definition:
AggregateFilter.h:30
include
madara
knowledge
Files.h
Generated on Wed May 9 2018 18:17:15 for MADARA by
1.8.11