<commit_before>#pragma once

#include <Transformation.h>
#include <EventID.h>
#include <EventType.h>

#include <boost/graph/adjacency_list.hpp>

#include <ostream>
#include <utility>

class CompositeTransformation : public AbstractConfiguredTransformation {
  public:
    class ConfiguredTransformation : public AbstractConfiguredTransformation {
      private:
        TransformationPtr mTPtr;
      public:
        using TransPtr = Transformation::TransPtr;
        ConfiguredTransformation() = default;
        ConfiguredTransformation(TransformationPtr tPtr, const EventType& out, const EventType& provided)
          : mTPtr(tPtr) {
          mOut = out;
          if(provided==EventType())
            mIn = tPtr->in(out);
          else
            mIn = tPtr->in(out, provided);
        }
        TransformationPtr trans() const { return mTPtr; }
        TransPtr create(const AbstractPolicy& policy) const { return mTPtr->create(mOut, mIn, policy); }
    };
    using  Graph       = boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS,
                                                ConfiguredTransformation, EventType>;
    using Vertex       = Graph::vertex_descriptor;
    using VertexResult = std::pair<Vertex, bool>;
    using VertexList   = std::vector<Vertex>;
    using TransPtr     = Transformation::TransPtr;
    using EventTypes   = Transformer::EventTypes;
    using EventIDs     = Transformation::EventIDs;
    using TransList    = std::vector<TransformationPtr>;

  private:
    Graph mGraph;
    Vertex mRoot;

  public:

    CompositeTransformation() = default;
    CompositeTransformation(TransformationPtr tPtr, const EventType& goal,
                            const EventType& provided);

    VertexResult addRootTransformation(TransformationPtr tPtr, const EventType& goal,
                                       const EventType& provided);
    VertexResult addTransformation(TransformationPtr tPtr, Vertex v,
                                   const EventType& goal, const EventType& provided);
    EventIDs inIDs() const;
    TransPtr create(const AbstractPolicy& policy) const;
    bool check() const;
    const Graph& graph() const { return mGraph; }
    Vertex root() const { return mRoot; }
    TransList path(Vertex v) const;
    VertexResult find(TransformationPtr tPtr) const;
    VertexList find(const EventType& eT) const;
    bool contains(TransformationPtr tPtr) const { return find(tPtr).second; }

  friend std::ostream& operator<<(std::ostream&, const ConfiguredTransformation&);
};

std::ostream& operator<<(std::ostream& o, const CompositeTransformation& t);<commit_msg>CompositeTransformation: remove unimplemented output operator<commit_after>#pragma once

#include <Transformation.h>
#include <EventID.h>
#include <EventType.h>

#include <boost/graph/adjacency_list.hpp>

#include <ostream>
#include <utility>

class CompositeTransformation : public AbstractConfiguredTransformation {
  public:
    class ConfiguredTransformation : public AbstractConfiguredTransformation {
      private:
        TransformationPtr mTPtr;
      public:
        using TransPtr = Transformation::TransPtr;
        ConfiguredTransformation() = default;
        ConfiguredTransformation(TransformationPtr tPtr, const EventType& out, const EventType& provided)
          : mTPtr(tPtr) {
          mOut = out;
          if(provided==EventType())
            mIn = tPtr->in(out);
          else
            mIn = tPtr->in(out, provided);
        }
        TransformationPtr trans() const { return mTPtr; }
        TransPtr create(const AbstractPolicy& policy) const { return mTPtr->create(mOut, mIn, policy); }
    };
    using  Graph       = boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS,
                                                ConfiguredTransformation, EventType>;
    using Vertex       = Graph::vertex_descriptor;
    using VertexResult = std::pair<Vertex, bool>;
    using VertexList   = std::vector<Vertex>;
    using TransPtr     = Transformation::TransPtr;
    using EventTypes   = Transformer::EventTypes;
    using EventIDs     = Transformation::EventIDs;
    using TransList    = std::vector<TransformationPtr>;

  private:
    Graph mGraph;
    Vertex mRoot;

  public:

    CompositeTransformation() = default;
    CompositeTransformation(TransformationPtr tPtr, const EventType& goal,
                            const EventType& provided);

    VertexResult addRootTransformation(TransformationPtr tPtr, const EventType& goal,
                                       const EventType& provided);
    VertexResult addTransformation(TransformationPtr tPtr, Vertex v,
                                   const EventType& goal, const EventType& provided);
    EventIDs inIDs() const;
    TransPtr create(const AbstractPolicy& policy) const;
    bool check() const;
    const Graph& graph() const { return mGraph; }
    Vertex root() const { return mRoot; }
    TransList path(Vertex v) const;
    VertexResult find(TransformationPtr tPtr) const;
    VertexList find(const EventType& eT) const;
    bool contains(TransformationPtr tPtr) const { return find(tPtr).second; }
};

std::ostream& operator<<(std::ostream& o, const CompositeTransformation& t);
{'fraction_non_alphanumeric': 0.09042350247996948, 'fraction_numerical': 0.0, 'mean_word_length': 3.0299769408147577, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4491864', 'n_tokens_mistral': 1412, 'n_tokens_neox': 1377, 'n_words': 362}