Skip to content
Open
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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ci:
autoupdate_branch: 'devel'
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v20.1.8
rev: v21.1.1
hooks:
- id: clang-format
args: [--style=Google]
Expand Down
433 changes: 215 additions & 218 deletions include/dynamic-graph/command-bind.h

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions include/dynamic-graph/command-direct-getter.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,24 @@ class DirectGetter : public Command {
typedef T (E::*GetterMethod)() const;

/// Constructor
DirectGetter(E &entity, T *ptr, const std::string &docString)
DirectGetter(E& entity, T* ptr, const std::string& docString)
: Command(entity, std::vector<Value::Type>(), docString), T_ptr(ptr) {}

protected:
virtual Value doExecute() { return Value(*T_ptr); }

private:
T *T_ptr;
T* T_ptr;
};

template <class E, typename T>
DirectGetter<E, T> *makeDirectGetter(E &entity, T *ptr,
const std::string &docString) {
DirectGetter<E, T>* makeDirectGetter(E& entity, T* ptr,
const std::string& docString) {
return new DirectGetter<E, T>(entity, ptr, docString);
}

inline std::string docDirectGetter(const std::string &name,
const std::string &type) {
inline std::string docDirectGetter(const std::string& name,
const std::string& type) {
return std::string("\nGet the ") + name + ".\n\nNo input.\nReturn an " +
type + ".\n\n";
}
Expand Down
14 changes: 7 additions & 7 deletions include/dynamic-graph/command-direct-setter.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,31 @@ namespace command {
template <class E, typename T>
class DirectSetter : public Command {
public:
DirectSetter(E &entity, T *ptr, const std::string &docString)
DirectSetter(E& entity, T* ptr, const std::string& docString)
: Command(entity, boost::assign::list_of(ValueHelper<T>::TypeID),
docString),
T_ptr(ptr) {}

protected:
virtual Value doExecute() {
const std::vector<Value> &values = getParameterValues();
const std::vector<Value>& values = getParameterValues();
T val = values[0].value();
(*T_ptr) = val;
return Value(); // void
}

private:
T *T_ptr;
T* T_ptr;
};

template <class E, typename T>
DirectSetter<E, T> *makeDirectSetter(E &entity, T *ptr,
const std::string &docString) {
DirectSetter<E, T>* makeDirectSetter(E& entity, T* ptr,
const std::string& docString) {
return new DirectSetter<E, T>(entity, ptr, docString);
}

inline std::string docDirectSetter(const std::string &name,
const std::string &type) {
inline std::string docDirectSetter(const std::string& name,
const std::string& type) {
return std::string("\nSet the ") + name + ".\n\nInput:\n - a " + type +
".\nVoid return.\n\n";
}
Expand Down
2 changes: 1 addition & 1 deletion include/dynamic-graph/command-getter.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Getter : public Command {
/// Pointer to method that sets parameter of type T
typedef T (E::*GetterMethod)() const;
/// Constructor
Getter(E &entity, GetterMethod getterMethod, const std::string &docString);
Getter(E& entity, GetterMethod getterMethod, const std::string& docString);

protected:
virtual Value doExecute();
Expand Down
6 changes: 3 additions & 3 deletions include/dynamic-graph/command-getter.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ class Entity;
namespace command {

template <class E, typename T>
Getter<E, T>::Getter(E &entity, GetterMethod getterMethod,
const std::string &docstring)
Getter<E, T>::Getter(E& entity, GetterMethod getterMethod,
const std::string& docstring)
: Command(entity, std::vector<Value::Type>(), docstring),
getterMethod_(getterMethod) {}

template <class E, typename T>
Value Getter<E, T>::doExecute() {
E &entity = static_cast<E &>(owner());
E& entity = static_cast<E&>(owner());
T value = (entity.*getterMethod_)();
return Value(value);
}
Expand Down
4 changes: 2 additions & 2 deletions include/dynamic-graph/command-setter.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ template <class E, typename T>
class Setter : public Command {
public:
/// Pointer to method that sets parameter of type T
typedef void (E::*SetterMethod)(const T &);
typedef void (E::*SetterMethod)(const T&);
/// Constructor
Setter(E &entity, SetterMethod setterMethod, const std::string &docString);
Setter(E& entity, SetterMethod setterMethod, const std::string& docString);

protected:
virtual Value doExecute();
Expand Down
Loading