Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

TableType Class Reference

#include <Type.h>

Inheritance diagram for TableType:

Inheritance graph
[legend]
Collaboration diagram for TableType:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TableType (TypeList *ind, BroType *yield)

Protected Member Functions

 TableType ()
TypeListExpandRecordIndex (RecordType *rt) const

Constructor & Destructor Documentation

TableType::TableType TypeList ind,
BroType yield
 

Definition at line 455 of file Type.cc.

References BroObj::Error(), BroType::InternalType(), InternalTypeTag, loop_over_list, BroType::SetError(), BroType::Tag(), TYPE_FUNC, TYPE_INTERNAL_ERROR, TYPE_INTERNAL_OTHER, TYPE_RECORD, TYPE_TABLE, and TypeList::Types().

00456 : IndexType(TYPE_TABLE, ind, yield)
00457         {
00458         if ( ! indices )
00459                 return;
00460 
00461         type_list* tl = indices->Types();
00462 
00463         loop_over_list(*tl, i)
00464                 {
00465                 BroType* tli = (*tl)[i];
00466                 InternalTypeTag t = tli->InternalType();
00467 
00468                 if ( t == TYPE_INTERNAL_ERROR )
00469                         break;
00470 
00471                 // Allow functions, since they can be compared
00472                 // for Func* pointer equality.
00473                 if ( t == TYPE_INTERNAL_OTHER && tli->Tag() != TYPE_FUNC &&
00474                      tli->Tag() != TYPE_RECORD )
00475                         {
00476                         tli->Error("bad index type");
00477                         SetError();
00478                         break;
00479                         }
00480                 }
00481         }

TableType::TableType  )  [inline, protected]
 

Definition at line 342 of file Type.h.

00342 {}


Member Function Documentation

TypeList * TableType::ExpandRecordIndex RecordType rt  )  const [protected]
 

Definition at line 483 of file Type.cc.

References TypeList::Append(), RecordType::FieldDecl(), RecordType::NumFields(), and TypeDecl::type.

00484         {
00485         TypeList* tl = new TypeList();
00486 
00487         int n = rt->NumFields();
00488         for ( int i = 0; i < n; ++i )
00489                 {
00490                 TypeDecl* td = rt->FieldDecl(i);
00491                 tl->Append(td->type->Ref());
00492                 }
00493 
00494         return tl;
00495         }


The documentation for this class was generated from the following files:
Generated on Wed Sep 14 03:14:17 2005 for bro_docs by doxygen 1.3.5