summaryrefslogtreecommitdiffabout
path: root/lib/Config/HAProxy/Node/Root.pm
blob: ca6e575155a280204f6fe1842f746ae3456b9fea (plain)
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
78
79
80
81
package Config::HAProxy::Node::Root;
use strict;
use warnings;
use parent 'Config::HAProxy::Node::Section';
use Carp;

=head1 NAME

Config::HAProxy::Node::Root - root node of HAProxy configuration parse tree

=head1 DESCRIPTION

Objects of this class represent the topmost node in HAProxy configuration tree.
Each parse tree contains exactly one object of this class. This node can be
reached from every node in the tree by following its B<parent> attribute
and is returned by the B<tree> method of B<Config::HAProxy> class.

=cut

sub new {
    my $class = shift;
    my $self = $class->SUPER::new(@_);
    $self->{dirty} = 0;
    return $self;
}

=head1 METHODS

=head2 is_root

Always true.

=head2 is_dirty

    $bool = $node->is_dirty;

Returns true if the tree is C<dirty>, i.e. it was modified since it has been
created from the disk configuration file.

=cut

sub is_dirty {
    my $self = shift;
    return $self->{dirty}
}

=head2 mark_dirty

    $node->mark_dirty;

Sets the C<dirty> attribute.

=cut

sub mark_dirty {
    my $self = shift;
    $self->{dirty} = 1;
}

=head2 clear_dirty

    $node->clear_dirty;

Clears the C<dirty> attribute.

=cut

sub clear_dirty {
    my $self = shift;
    $self->{dirty} = 0;
}

=head1 SEE ALSO

B<Config::HAProxy::Node>.

=cut

1;

    

Return to:

Send suggestions and report system problems to the System administrator.