package Net::SolarWinds::ConstructorHash;

use strict;
use warnings;
use base qw( Net::SolarWinds::LogMethods);


=head1 NAME

Net::SolarWinds::ConstructorHash - Default Hash object constructor


  package MyClass;
  use base qw(Net::SolarWinds::ConstructorHash);
  my $pkg=new MyClass(key=>'value');


This library provides a common base line construcotor that accepts an arbitrary key=>value pair set.

=head1 Setting default constructor values.

To create default constructor values, simply use the inherited OO constructor example:

  sub new {
  	my ($class,%args)=@_;
  	return $class->SUPER::new(

=head1 OO Methods provided

=over 4

=item * Object constructor

This class provides a basic object constructor that accepts hash key value pairs as its arguments.  Keep in mind there are a few reserved hash keys.

Reserved hash keys:

    # wich is used to manage the shutdown state.

  log=>undef|Net::SolarWinds::Log instance
    # this key represents the log object ( if passed into the constructor as class->new(log=>Net::SolarWinds::Log->new()) )


sub new {
    my ( $class, %args ) = @_;

    my $self = bless { log => undef, _shutdown => 0, %args }, $class;

    return $self;

=item * $self->is_shutdown

This method should be used when running infinate loops to see if the application should stop running its extended loop.


sub is_shutdown { return $_[0]->{_shutdown} }

=item * $self->set_shutdown

Sets the object into the shutdown state.


sub set_shutdown { $_[0]->{_shutdown} = 1 }


=head1 AUTHOR

Michael Shipper