class Paludis::FilteredGenerator

A combined Generator and Filter for an Environment selection.

Public Class Methods

new(p1, p2) click to toggle source
VALUE
    filtered_generator_new(VALUE self, VALUE generator, VALUE filter)
    {
        FilteredGenerator * ptr(0);
        try
        {
            Generator g(value_to_generator(generator));
            Filter f(value_to_filter(filter));
            ptr = new FilteredGenerator(g, f);
            VALUE data(Data_Wrap_Struct(self, 0, &Common<FilteredGenerator>::free, ptr));
            rb_obj_call_init(data, 2, &self);
            return data;
        }
        catch (const std::exception & e)
        {
            delete ptr;
            exception_to_ruby_exception(e);
        }
    }

    /*
     * Document-method: |
     *
     * call-seq:
     *     |(filter) -> FilteredGenerator
     *
     * Add a new Filter.
     */
    VALUE
    filtered_generator_bar(VALUE self, VALUE other)
    {
        FilteredGenerator * ptr(0);
        try
        {
            FilteredGenerator g1(value_to_filtered_generator(self));
            Filter f1(value_to_filter(other));
            return filtered_generator_to_value(g1 | f1);
        }
        catch (const std::exception & e)
        {
            delete ptr;
            exception_to_ruby_exception(e);
        }
    }

    /*
     * call-seq:
     *     filter -> Filter
     *
     * Our Filter.
     */
    VALUE
    filtered_generator_filter(VALUE self)
    {
        FilteredGenerator * ptr(0);
        try
        {
            FilteredGenerator g1(value_to_filtered_generator(self));
            return filter_to_value(g1.filter());
        }
        catch (const std::exception & e)
        {
            delete ptr;
            exception_to_ruby_exception(e);
        }
    }

    /*
     * call-seq:
     *     generator -> Generator
     *
     * Our Generator.
     */
    VALUE
    filtered_generator_generator(VALUE self)
    {
        FilteredGenerator * ptr(0);
        try
        {
            FilteredGenerator g1(value_to_filtered_generator(self));
            return generator_to_value(g1.generator());
        }
        catch (const std::exception & e)
        {
            delete ptr;
            exception_to_ruby_exception(e);
        }
    }

    void do_register_filtered_generator()
    {
        /*
         * Document-class: Paludis::FilteredGenerator
         *
         * A combined Generator and Filter for an Environment selection.
         */
        c_filtered_generator = rb_define_class_under(c_paludis_module, "FilteredGenerator", rb_cObject);
        rb_define_singleton_method(c_filtered_generator, "new", filtered_generator_new, 2);
        rb_define_method(c_filtered_generator, "initialize", filtered_generator_init, -1);
        rb_define_method(c_filtered_generator, "to_s", template_methods, 0);
        rb_define_method(c_filtered_generator, "|", filtered_generator_bar, 1);
        rb_define_method(c_filtered_generator, "filter", filtered_generator_filter, 0);
        rb_define_method(c_filtered_generator, "generator", filtered_generator_generator, 0);
    }
}

Public Instance Methods

filter → Filter click to toggle source

Our Filter.

VALUE
    filtered_generator_filter(VALUE self)
    {
        FilteredGenerator * ptr(0);
        try
        {
            FilteredGenerator g1(value_to_filtered_generator(self));
            return filter_to_value(g1.filter());
        }
        catch (const std::exception & e)
        {
            delete ptr;
            exception_to_ruby_exception(e);
        }
    }

    /*
     * call-seq:
     *     generator -> Generator
     *
     * Our Generator.
     */
    VALUE
    filtered_generator_generator(VALUE self)
    {
        FilteredGenerator * ptr(0);
        try
        {
            FilteredGenerator g1(value_to_filtered_generator(self));
            return generator_to_value(g1.generator());
        }
        catch (const std::exception & e)
        {
            delete ptr;
            exception_to_ruby_exception(e);
        }
    }

    void do_register_filtered_generator()
    {
        /*
         * Document-class: Paludis::FilteredGenerator
         *
         * A combined Generator and Filter for an Environment selection.
         */
        c_filtered_generator = rb_define_class_under(c_paludis_module, "FilteredGenerator", rb_cObject);
        rb_define_singleton_method(c_filtered_generator, "new", filtered_generator_new, 2);
        rb_define_method(c_filtered_generator, "initialize", filtered_generator_init, -1);
        rb_define_method(c_filtered_generator, "to_s", template_methods, 0);
        rb_define_method(c_filtered_generator, "|", filtered_generator_bar, 1);
        rb_define_method(c_filtered_generator, "filter", filtered_generator_filter, 0);
        rb_define_method(c_filtered_generator, "generator", filtered_generator_generator, 0);
    }
}
generator → Generator click to toggle source

Our Generator.

VALUE
    filtered_generator_generator(VALUE self)
    {
        FilteredGenerator * ptr(0);
        try
        {
            FilteredGenerator g1(value_to_filtered_generator(self));
            return generator_to_value(g1.generator());
        }
        catch (const std::exception & e)
        {
            delete ptr;
            exception_to_ruby_exception(e);
        }
    }

    void do_register_filtered_generator()
    {
        /*
         * Document-class: Paludis::FilteredGenerator
         *
         * A combined Generator and Filter for an Environment selection.
         */
        c_filtered_generator = rb_define_class_under(c_paludis_module, "FilteredGenerator", rb_cObject);
        rb_define_singleton_method(c_filtered_generator, "new", filtered_generator_new, 2);
        rb_define_method(c_filtered_generator, "initialize", filtered_generator_init, -1);
        rb_define_method(c_filtered_generator, "to_s", template_methods, 0);
        rb_define_method(c_filtered_generator, "|", filtered_generator_bar, 1);
        rb_define_method(c_filtered_generator, "filter", filtered_generator_filter, 0);
        rb_define_method(c_filtered_generator, "generator", filtered_generator_generator, 0);
    }
}
|(filter) → FilteredGenerator click to toggle source

Add a new Filter.

VALUE
    filtered_generator_bar(VALUE self, VALUE other)
    {
        FilteredGenerator * ptr(0);
        try
        {
            FilteredGenerator g1(value_to_filtered_generator(self));
            Filter f1(value_to_filter(other));
            return filtered_generator_to_value(g1 | f1);
        }
        catch (const std::exception & e)
        {
            delete ptr;
            exception_to_ruby_exception(e);
        }
    }

    /*
     * call-seq:
     *     filter -> Filter
     *
     * Our Filter.
     */
    VALUE
    filtered_generator_filter(VALUE self)
    {
        FilteredGenerator * ptr(0);
        try
        {
            FilteredGenerator g1(value_to_filtered_generator(self));
            return filter_to_value(g1.filter());
        }
        catch (const std::exception & e)
        {
            delete ptr;
            exception_to_ruby_exception(e);
        }
    }

    /*
     * call-seq:
     *     generator -> Generator
     *
     * Our Generator.
     */
    VALUE
    filtered_generator_generator(VALUE self)
    {
        FilteredGenerator * ptr(0);
        try
        {
            FilteredGenerator g1(value_to_filtered_generator(self));
            return generator_to_value(g1.generator());
        }
        catch (const std::exception & e)
        {
            delete ptr;
            exception_to_ruby_exception(e);
        }
    }

    void do_register_filtered_generator()
    {
        /*
         * Document-class: Paludis::FilteredGenerator
         *
         * A combined Generator and Filter for an Environment selection.
         */
        c_filtered_generator = rb_define_class_under(c_paludis_module, "FilteredGenerator", rb_cObject);
        rb_define_singleton_method(c_filtered_generator, "new", filtered_generator_new, 2);
        rb_define_method(c_filtered_generator, "initialize", filtered_generator_init, -1);
        rb_define_method(c_filtered_generator, "to_s", template_methods, 0);
        rb_define_method(c_filtered_generator, "|", filtered_generator_bar, 1);
        rb_define_method(c_filtered_generator, "filter", filtered_generator_filter, 0);
        rb_define_method(c_filtered_generator, "generator", filtered_generator_generator, 0);
    }
}