eval 'exec perl -x $0 ${1+"$@"}' # -*-perl-*-
  if 0;
#!perl -w
#
# ======================================================================
# This file is Copyright 1998,1999 by the Purdue Research Foundation and
# may only be used under license.  For terms of the license, see the
# file named COPYRIGHT included with this software release.
# AAFID is a trademark of the Purdue Research Foundation.
# All rights reserved.
# ======================================================================
#
# AAFID2 system
# Agent name:        test
# Agent description: Test Agent in AAFID Agent Specification format
# Author:            Diego Zamboni
#
# History of modifications:
# 
# Known bugs:
# - It doesn't do anything useful.
# 
# Things to do:
# 
# Future work:
# 
# Suggestions made by people:
# 
# Generated automatically by ../bin/makeagent.pl on Tue Sep  7 23:55:59 1999.
# 
###### AUTOMATICALLY GENERATED FILE --- DO NOT EDIT ##########
#

# 11 "test.aas"
package test;

# Version number
# 13 "test.aas"
$VERSION=eval {1.0}; $VERSION=$VERSION;

# Agent parameters
%PARAMETERS=(
             Description        => "Test Agent in AAFID Agent Specification format",
             CheckPeriod        => eval {10},
# 48 "test.aas"
             MyFileToMonitor => "/var/adm/messages",
             MyDummyParam => 1,
             FiltersNeeded => {  }
            );

# Package loading
use AAFID::Agent;
use AAFID::Log;
use AAFID::Common;


use vars qw (
             @ISA
             $VERSION
             %PARAMETERS
            );

# Define the superclass.
 @ISA=qw(AAFID::Agent);

=head1 test



=cut

# Preamble code


# Provide an Init function.
sub Init {
  my $self=checkref(shift);
# 18 "test.aas"
  $Params{Dir}=1;
  return $self;
}

# The Check function.
sub Check {
  my $self=checkref(shift);
# 21 "test.aas"
  my $count=$Params{Count};
  my $direction=$Params{Dir};
  if ($direction) {
    $count++;
  }
  else {
    $count--;
  }
  if ($count>10) {
    $count=9;
    $direction=0;
  }
  if ($count<0) {
    $count=0;
    $direction=1;
  }
  $Params{Count}=$count;
  $Params{Dir}=$direction;
  return ($count, "My status is $count");
}
# Agent commands

sub command_GETCOUNT {
  my $self=checkref(shift);
  my ($message, %p)=@_;
  if (1) {
    
# 45 "test.aas"
  return {Count => $Params{Count}};
    # By default, return undef
    return undef;
  }
}

sub command_SETCOUNT {
  my $self=checkref(shift);
  my ($message, %p)=@_;
  if (exists($p{NewCount}) && 1) {
    my $NewCount = $p{NewCount};
# 42 "test.aas"
  $Params{Count}=$NewCount;
    # By default, return undef
    return undef;
  }
}

# End of entity marker
_EndOfEntity;
