/usr/lib/R/site-library/dplyr/include/dplyr/DataFrameJoinVisitors.h is in r-cran-dplyr 0.7.4-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | #ifndef dplyr_DataFrameJoinVisitors_H
#define dplyr_DataFrameJoinVisitors_H
#include <tools/pointer_vector.h>
#include <dplyr/visitor_set/VisitorSetMixin.h>
#include <dplyr/tbl_cpp.h>
#include <dplyr/JoinVisitor.h>
namespace dplyr {
class DataFrameJoinVisitors :
public VisitorSetEqual<DataFrameJoinVisitors>,
public VisitorSetHash<DataFrameJoinVisitors>
{
public:
typedef JoinVisitor visitor_type;
DataFrameJoinVisitors(
const DataFrame& left_,
const DataFrame& right_,
const SymbolVector& names_left,
const SymbolVector& names_right,
bool warn_,
bool na_match
);
inline JoinVisitor* get(int k) const {
return visitors[k];
}
inline JoinVisitor* get(const SymbolString& name) const {
for (int i = 0; i < nvisitors; i++) {
if (name == visitor_names_left[i]) return get(i);
}
stop("visitor not found for name '%s' ", name.get_utf8_cstring());
}
inline int size() const {
return nvisitors;
}
template <typename Container>
inline DataFrame subset(const Container& index, const CharacterVector& classes) {
int nrows = index.size();
Rcpp::List out(nvisitors);
for (int k = 0; k < nvisitors; k++) {
out[k] = get(k)->subset(index);
}
set_class(out, classes);
set_rownames(out, nrows);
out.names() = visitor_names_left;
copy_vars(out, left);
return (SEXP)out;
}
const SymbolVector& left_names() const {
return visitor_names_left;
}
const SymbolVector& right_names() const {
return visitor_names_right;
}
private:
const DataFrame& left;
const DataFrame& right;
SymbolVector visitor_names_left;
SymbolVector visitor_names_right;
int nvisitors;
pointer_vector<JoinVisitor> visitors;
bool warn;
};
}
#endif
|