Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions cpp/common/include/ClassLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#ifndef ODIN_DATA_CLASSLOADER_H_
#define ODIN_DATA_CLASSLOADER_H_

#include <boost/shared_ptr.hpp>
#include <dlfcn.h>
#include <map>
#include <memory>
#include <stdexcept>
#include <stdio.h>
#include <string>
Expand All @@ -23,9 +23,9 @@ namespace OdinData {
* Function template to instantiate a class.
* It returns a shared pointer to its base class
*/
template <typename BaseClass, typename SubClass> boost::shared_ptr<BaseClass> maker()
template <typename BaseClass, typename SubClass> std::shared_ptr<BaseClass> maker()
{
boost::shared_ptr<BaseClass> ptr = boost::shared_ptr<BaseClass>(new SubClass);
std::shared_ptr<BaseClass> ptr = std::shared_ptr<BaseClass>(new SubClass);
return ptr;
}

Expand All @@ -43,7 +43,7 @@ template <typename BaseClass> class ClassLoader {
/**
* Shared pointer to the specified BaseClass
*/
typedef boost::shared_ptr<BaseClass> maker_t();
typedef std::shared_ptr<BaseClass> maker_t();

public:
/**
Expand All @@ -61,7 +61,7 @@ template <typename BaseClass> class ClassLoader {
* \param[in] name - name of class to load
* \param[in] path - full path of the library to load
*/
static boost::shared_ptr<BaseClass> load_class(const std::string& name, const std::string& path)
static std::shared_ptr<BaseClass> load_class(const std::string& name, const std::string& path)
{
// First do we already have this class loaded?
if (!is_registered(name)) {
Expand All @@ -83,7 +83,7 @@ template <typename BaseClass> class ClassLoader {
// make function with the factory map ready to produce instances.
}
}
boost::shared_ptr<BaseClass> obj;
std::shared_ptr<BaseClass> obj;
try {
if (factory_map().count(name)) {
obj = factory_map()[name]();
Expand Down
2 changes: 0 additions & 2 deletions cpp/common/include/IpcChannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
#include <map>

#include "zmq/zmq.hpp"
#include <boost/bind/bind.hpp>
#include <boost/function.hpp>

namespace OdinData {

Expand Down
16 changes: 7 additions & 9 deletions cpp/common/include/IpcReactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,15 @@
#ifndef IPCREACTOR_H_
#define IPCREACTOR_H_

#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <mutex>
#include <sstream>
#include <time.h>

#include "zmq/zmq.hpp"
#include <boost/bind/bind.hpp>
#include <boost/function.hpp>
#include <boost/ref.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/thread.hpp>

#include "IpcChannel.h"
#include "OdinDataException.h"
Expand All @@ -44,7 +42,7 @@ class IpcReactorException : public OdinDataException {
};

//! Function signature for timer callback methods
typedef boost::function<void()> TimerCallback;
typedef std::function<void()> TimerCallback;

//! Reactor millisecond time type
typedef int64_t TimeMs;
Expand Down Expand Up @@ -86,7 +84,7 @@ class IpcReactorTimer {
};

//! Function signature for reactor callback methods
typedef boost::function<void()> ReactorCallback;
typedef std::function<void()> ReactorCallback;

//! Pointer to underlying ZMQ socket of a channel
typedef zmq::socket_t* SocketPtr;
Expand All @@ -97,7 +95,7 @@ typedef std::map<SocketPtr, ReactorCallback> ChannelMap;
typedef std::map<int, ReactorCallback> SocketMap;

//! Internal map to associate timer ID with a timer
typedef std::map<int, boost::shared_ptr<IpcReactorTimer>> TimerMap;
typedef std::map<int, std::shared_ptr<IpcReactorTimer>> TimerMap;

class IpcReactor {
public:
Expand Down Expand Up @@ -143,7 +141,7 @@ class IpcReactor {
ReactorCallback* callbacks_; //!< Ptr to matched array of callbacks
std::size_t pollsize_; //!< Number if active items to poll
bool needs_rebuild_; //!< Indicates that the poll item list needs rebuilding
boost::mutex mutex_; //!< Mutex used to make some calls in this class thread safe
std::mutex mutex_; //!< Mutex used to make some calls in this class thread safe
};

} // namespace OdinData
Expand Down
20 changes: 9 additions & 11 deletions cpp/common/include/ParamContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@
#ifndef PARAMCONTAINER_H_
#define PARAMCONTAINER_H_

#include <boost/bind/bind.hpp>
#include <boost/function.hpp>
#include <functional>
#include <map>
#include <string>
#include <vector>

#ifdef BOOST_HAS_PLACEHOLDERS
using namespace boost::placeholders;
#endif
using namespace std::placeholders;

namespace OdinData {

Expand Down Expand Up @@ -66,11 +64,11 @@ namespace OdinData {
class ParamContainer {

//! Parameter setter function type definition
typedef boost::function<void(rapidjson::Value&)> SetterFunc;
typedef std::function<void(rapidjson::Value&)> SetterFunc;
//! Parameter setter function map type definition
typedef std::map<std::string, SetterFunc> SetterFuncMap;
//! Parameter getter function type definition
typedef boost::function<void(rapidjson::Value&)> GetterFunc;
typedef std::function<void(rapidjson::Value&)> GetterFunc;
//! Parameter getter function map type definition
typedef std::map<std::string, GetterFunc> GetterFuncMap;

Expand Down Expand Up @@ -120,10 +118,10 @@ class ParamContainer {
template <typename T> void bind_param(T& param, const std::string& path)
{
// Bind the parameter into the setter function map
setter_map_[path] = boost::bind(&ParamContainer::param_set<T>, this, boost::ref(param), _1);
setter_map_[path] = std::bind(&ParamContainer::param_set<T>, this, std::ref(param), _1);

// Bind the parameter into the getter function map
getter_map_[path] = boost::bind(&ParamContainer::param_get<T>, this, boost::ref(param), _1);
getter_map_[path] = std::bind(&ParamContainer::param_get<T>, this, std::ref(param), _1);
}

//! Bind a vector parameter to a path in the container.
Expand All @@ -138,10 +136,10 @@ class ParamContainer {
template <typename T> void bind_vector_param(std::vector<T>& param, const std::string& path)
{
// Bind the vector parameter into the setter function map
setter_map_[path] = boost::bind(&ParamContainer::vector_param_set<T>, this, boost::ref(param), _1);
setter_map_[path] = std::bind(&ParamContainer::vector_param_set<T>, this, std::ref(param), _1);

// Bind the vector parameter into the getter function map
getter_map_[path] = boost::bind(&ParamContainer::vector_param_get<T>, this, boost::ref(param), _1);
getter_map_[path] = std::bind(&ParamContainer::vector_param_get<T>, this, std::ref(param), _1);
}

//! Set the value of a parameter in the container.
Expand Down
4 changes: 2 additions & 2 deletions cpp/common/include/SharedBufferManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
#ifndef SHAREDBUFFERMANAGER_H_
#define SHAREDBUFFERMANAGER_H_

#include <memory>
#include <stddef.h>
#include <string>

#include <boost/interprocess/mapped_region.hpp>
#include <boost/interprocess/shared_memory_object.hpp>
#include <boost/shared_ptr.hpp>

#include "OdinDataException.h"

Expand Down Expand Up @@ -63,7 +63,7 @@ class SharedBufferManager {
static size_t last_manager_id;
};

typedef boost::shared_ptr<SharedBufferManager> SharedBufferManagerPtr;
typedef std::shared_ptr<SharedBufferManager> SharedBufferManagerPtr;

} // namespace OdinData
#endif /* SHAREDBUFFERMANAGER_H_ */
10 changes: 5 additions & 5 deletions cpp/common/src/IpcReactor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,10 @@ void IpcReactor::remove_socket(int socket_fd)
int IpcReactor::register_timer(size_t delay_ms, size_t times, TimerCallback callback)
{
// Take lock while modifying timers_
boost::lock_guard<boost::mutex> lock(mutex_);
std::lock_guard<std::mutex> lock(mutex_);

// Create a smart pointer to a new timer object
boost::shared_ptr<IpcReactorTimer> timer(new IpcReactorTimer(delay_ms, times, callback));
std::shared_ptr<IpcReactorTimer> timer(new IpcReactorTimer(delay_ms, times, callback));

// Add the timer to the timer map
timers_[timer->get_id()] = timer;
Expand All @@ -228,7 +228,7 @@ int IpcReactor::register_timer(size_t delay_ms, size_t times, TimerCallback call
void IpcReactor::remove_timer(int timer_id)
{
// Take lock while modifying timers_
boost::lock_guard<boost::mutex> lock(mutex_);
std::lock_guard<std::mutex> lock(mutex_);
timers_.erase(timer_id);
}

Expand All @@ -244,7 +244,7 @@ void IpcReactor::remove_timer(int timer_id)
int IpcReactor::run(void)
{
int rc = 0;
boost::unique_lock<boost::mutex> lock(mutex_, boost::defer_lock);
std::unique_lock<std::mutex> lock(mutex_, std::defer_lock);

// Loop until the terminate flag is set
while (!terminate_reactor_) {
Expand Down Expand Up @@ -387,7 +387,7 @@ void IpcReactor::rebuild_pollitems(void)
long IpcReactor::calculate_timeout(void)
{
// Take lock while accessing timers_
boost::lock_guard<boost::mutex> lock(mutex_);
std::lock_guard<std::mutex> lock(mutex_);

// Calculate shortest timeout up to one hour (!!), looping through
// current timers to see which fires first
Expand Down
16 changes: 7 additions & 9 deletions cpp/frameProcessor/include/Acquisition.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
#include <string>
#include <vector>

#include <boost/shared_ptr.hpp>

#include <log4cxx/logger.h>
using namespace log4cxx;

Expand All @@ -30,9 +28,9 @@ class Acquisition : public MetaMessagePublisher {
Acquisition(const HDF5ErrorDefinition_t& hdf5_error_definition);
~Acquisition();
std::string get_last_error();
ProcessFrameStatus process_frame(boost::shared_ptr<Frame> frame, HDF5CallDurations_t& call_durations);
ProcessFrameStatus process_frame(std::shared_ptr<Frame> frame, HDF5CallDurations_t& call_durations);
void create_file(size_t file_number, HDF5CallDurations_t& call_durations);
void close_file(boost::shared_ptr<HDF5File> file, HDF5CallDurations_t& call_durations);
void close_file(std::shared_ptr<HDF5File> file, HDF5CallDurations_t& call_durations);
void validate_dataset_definition(DatasetDefinition definition);
bool start_acquisition(
size_t concurrent_rank,
Expand All @@ -50,11 +48,11 @@ class Acquisition : public MetaMessagePublisher {
HDF5CallDurations_t& call_durations
);
void stop_acquisition(HDF5CallDurations_t& call_durations);
bool check_frame_valid(boost::shared_ptr<Frame> frame);
bool check_frame_valid(std::shared_ptr<Frame> frame);
size_t get_frame_offset_in_file(size_t frame_offset) const;
size_t get_file_index(size_t frame_offset) const;
size_t adjust_frame_offset(boost::shared_ptr<Frame> frame) const;
boost::shared_ptr<HDF5File> get_file(size_t frame_offset, HDF5CallDurations_t& call_durations);
size_t adjust_frame_offset(std::shared_ptr<Frame> frame) const;
std::shared_ptr<HDF5File> get_file(size_t frame_offset, HDF5CallDurations_t& call_durations);
std::string get_create_meta_header();
std::string get_meta_header();
std::string generate_filename(size_t file_number = 0);
Expand Down Expand Up @@ -112,9 +110,9 @@ class Acquisition : public MetaMessagePublisher {
std::string document_to_string(rapidjson::Document& document) const;

/** The current file that frames are being written to */
boost::shared_ptr<HDF5File> current_file_;
std::shared_ptr<HDF5File> current_file_;
/** The previous file that frames were written to, held in case of late frames */
boost::shared_ptr<HDF5File> previous_file_;
std::shared_ptr<HDF5File> previous_file_;
/** Most recently generated error message */
std::string last_error_;
};
Expand Down
8 changes: 4 additions & 4 deletions cpp/frameProcessor/include/BloscPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class BloscPlugin : public FrameProcessorPlugin {
static const std::string CONFIG_BLOSC_MODE;

// Baseclass API to implement:
void process_frame(boost::shared_ptr<Frame> frame);
void process_frame(std::shared_ptr<Frame> frame);
void configure(OdinData::IpcMessage& config, OdinData::IpcMessage& reply);
void requestConfiguration(OdinData::IpcMessage& reply);
int get_version_major();
Expand All @@ -58,8 +58,8 @@ class BloscPlugin : public FrameProcessorPlugin {

private:
// Methods unique to this class
std::pair<boost::shared_ptr<Frame>, bool> compress_frame(const boost::shared_ptr<Frame>& frame);
std::pair<boost::shared_ptr<Frame>, bool> decompress_frame(const boost::shared_ptr<Frame>& frame);
std::pair<std::shared_ptr<Frame>, bool> compress_frame(const std::shared_ptr<Frame>& frame);
std::pair<std::shared_ptr<Frame>, bool> decompress_frame(const std::shared_ptr<Frame>& frame);
void update_compression_settings();
friend struct Mode_map;
enum class Mode {
Expand All @@ -77,7 +77,7 @@ class BloscPlugin : public FrameProcessorPlugin {
/** Pointer to logger */
LoggerPtr logger_;
/** Mutex used to make this class thread safe */
boost::recursive_mutex mutex_;
std::recursive_mutex mutex_;
/** Current acquisition ID */
std::string current_acquisition_;
/** Compression settings */
Expand Down
4 changes: 1 addition & 3 deletions cpp/frameProcessor/include/DataBlockFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
#include "DataBlock.h"
#include "Frame.h"

#include <boost/shared_ptr.hpp>

namespace FrameProcessor {

class DataBlockFrame : public Frame {
Expand Down Expand Up @@ -36,7 +34,7 @@ class DataBlockFrame : public Frame {

private:
/** Pointer to raw data block */
boost::shared_ptr<DataBlock> raw_data_block_ptr_;
std::shared_ptr<DataBlock> raw_data_block_ptr_;
};

}
Expand Down
17 changes: 7 additions & 10 deletions cpp/frameProcessor/include/DataBlockPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@

#include <list>

#include <boost/shared_ptr.hpp>
#include <boost/thread.hpp>

#include "DataBlock.h"

namespace FrameProcessor {
Expand All @@ -33,8 +30,8 @@ class DataBlockPool {
virtual ~DataBlockPool();

static void allocate(size_t block_count, size_t block_size);
static boost::shared_ptr<DataBlock> take(size_t block_size);
static void release(boost::shared_ptr<DataBlock> block);
static std::shared_ptr<DataBlock> take(size_t block_size);
static void release(std::shared_ptr<DataBlock> block);
static size_t get_free_blocks(size_t block_size);
static size_t get_used_blocks(size_t block_size);
static size_t get_total_blocks(size_t block_size);
Expand All @@ -45,8 +42,8 @@ class DataBlockPool {
static DataBlockPool* instance(size_t block_size);
DataBlockPool();
void internal_allocate(size_t block_count, size_t block_size);
boost::shared_ptr<DataBlock> internal_take(size_t block_size);
void internal_release(boost::shared_ptr<DataBlock> block);
std::shared_ptr<DataBlock> internal_take(size_t block_size);
void internal_release(std::shared_ptr<DataBlock> block);
size_t internal_get_free_blocks();
size_t internal_get_used_blocks();
size_t internal_get_total_blocks();
Expand All @@ -55,11 +52,11 @@ class DataBlockPool {
/** Pointer to logger */
log4cxx::LoggerPtr logger_;
/** Mutex used to make this class thread safe */
boost::recursive_mutex mutex_;
std::recursive_mutex mutex_;
/** List of currently available DataBlock objects */
std::list<boost::shared_ptr<DataBlock>> free_list_;
std::list<std::shared_ptr<DataBlock>> free_list_;
/** Map of currently used DataBlock objects, indexed by their unique IDs */
std::map<int, boost::shared_ptr<DataBlock>> used_map_;
std::map<int, std::shared_ptr<DataBlock>> used_map_;
/** Number of currently available DataBlock objects */
size_t free_blocks_;
/** Number of currently used DataBlock objects */
Expand Down
4 changes: 2 additions & 2 deletions cpp/frameProcessor/include/DummyUDPProcessPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ class DummyUDPProcessPlugin : public FrameProcessorPlugin {
/** Command execution constant for print command **/
static const std::string EXECUTE_PRINT;

void process_frame(boost::shared_ptr<Frame> frame);
void process_lost_packets(boost::shared_ptr<Frame>& frame);
void process_frame(std::shared_ptr<Frame> frame);
void process_lost_packets(std::shared_ptr<Frame>& frame);

/** Pointer to logger */
LoggerPtr logger_;
Expand Down
Loading
Loading