System.ArgIterator Structure

Assembly: Mscorlib.dll
Namespace: System
Summary
Represents a variable-length argument list; that is, the parameters of a function that takes a variable number of arguments.
C# Syntax:
public struct ArgIterator
Remarks
Typically, you use this class for writing compilers. The methods in this class are not generally useful in other kinds of applications.

The functionality in this class is typically hidden in the syntax of a specific programming language. For example, the C++ programming language declares a variable-length argument list with an ellipsis ("...") at the end of a parameter list.

See also:
System Namespace

System.ArgIterator Member List:

Public Constructors
ctor #1 Overloaded:
.ctor(RuntimeArgumentHandle arglist)

Initializes a new instance of the ArgIterator class using the specified argument list.
ctor #2 Overloaded:
.ctor(RuntimeArgumentHandle arglist, void* ptr)

Initializes a new instance of the ArgIterator class using the specified argument list and a pointer to an item in the list.
Public Methods
End Moves the iterator to the end of the variable-length argument list; that is, it invalidates the iterator.
Equals Overridden:
This method is not supported, and always throws NotSupportedException.
GetHashCode Overridden:
Returns the hash code of this object.
GetNextArg Overloaded:
GetNextArg()

Returns the next argument in a variable-length argument list.
GetNextArg Overloaded:
GetNextArg(RuntimeTypeHandle rth)

Returns the next argument in a variable-length argument list that has a specified type.
GetNextArgType Returns the type of the next argument.
GetRemainingCount Returns the number of arguments remaining in the argument list.
GetType
(inherited from System.Object)
See base class member description: System.Object.GetType

Derived from System.Object, the primary base class for all objects.
ToString
(inherited from System.ValueType)
See base class member description: System.ValueType.ToString


Returns the fully qualified type name of this instance.
Protected Methods
Finalize
(inherited from System.Object)
See base class member description: System.Object.Finalize

Derived from System.Object, the primary base class for all objects.
MemberwiseClone
(inherited from System.Object)
See base class member description: System.Object.MemberwiseClone

Derived from System.Object, the primary base class for all objects.

Hierarchy:


System.ArgIterator Member Details

Overloaded ctor #1
Summary
Initializes a new instance of the ArgIterator class using the specified argument list.
C# Syntax:
public ArgIterator(
   RuntimeArgumentHandle arglist
);
Parameters:

arglist

An argument list consisting of both required and optional items.

Return to top


Overloaded ctor #2
Summary
Initializes a new instance of the ArgIterator class using the specified argument list and a pointer to an item in the list.
This member is not CLS Compliant

C# Syntax:
[CLSCompliant(false)]
unsafe public ArgIterator(
   RuntimeArgumentHandle arglist,
   void* ptr
);
Parameters:

arglist

An argument list consisting of both required and optional items.

ptr

A pointer to the item in arglist to be accessed first.

Remarks


Notes to implementors: This constructor is provided specifically for use with the C/C++ programming language.

Return to top


Method: End()
Summary
Moves the iterator to the end of the variable-length argument list; that is, it invalidates the iterator.
C# Syntax:
public void End();
Remarks
Conceptually, this method moves the iterator to the end of the list so that the next call to ArgIterator.GetNextArg generates an exception.

Return to top


Overridden Method: Equals(
   object o
)
Summary
This method is not supported, and always throws NotSupportedException.
C# Syntax:
public override bool Equals(
   object o
);
Parameters:

o

An object to be compared to this instance.

Return Value:
This comparison is not supported. No value is returned.
Exceptions
Exception Type Condition
NotSupportedException This method is not supported.

Return to top


Method: Finalize()
Inherited
See base class member description: System.Object.Finalize
C# Syntax:
~ArgIterator();

For more information on members inherited from System.Object click on the link above.

Return to top


Overridden Method: GetHashCode()
Summary
Returns the hash code of this object.
C# Syntax:
public override int GetHashCode();
Return Value:
A 32-bit signed integer hash code.

Return to top


Overloaded Method: GetNextArg()
Summary
Returns the next argument in a variable-length argument list.
This member is not CLS Compliant

C# Syntax:
[CLSCompliant(false)]
public TypedReference GetNextArg();
Return Value:
The next argument as a TypedReference object.
Exceptions
Exception Type Condition
Exception Attempt to read beyond the end of the list.
Remarks
The iterator is automatically advanced to the next argument.

Return to top


Overloaded Method: GetNextArg(
   RuntimeTypeHandle rth
)
Summary
Returns the next argument in a variable-length argument list that has a specified type.
This member is not CLS Compliant

C# Syntax:
[CLSCompliant(false)]
public TypedReference GetNextArg(
   RuntimeTypeHandle rth
);
Parameters:

rth

A runtime type handle that identifies the type of the argument to retrieve.

Return Value:
The next argument as a TypedReference object.
Exceptions
Exception Type Condition
Exception Attempt to read beyond the end of the list.
Remarks
The iterator is automatically advanced to the next argument.

Notes to implementors: This method is provided specifically for use with the C/C++ programming language.

Return to top


Method: GetNextArgType()
Summary
Returns the type of the next argument.
C# Syntax:
public RuntimeTypeHandle GetNextArgType();
Return Value:
The type of the next argument.
Remarks
This method does not advance the iterator to the next argument.

Return to top


Method: GetRemainingCount()
Summary
Returns the number of arguments remaining in the argument list.
C# Syntax:
public int GetRemainingCount();
Return Value:
The number of remaining arguments.

Return to top


Method: GetType()
Inherited
See base class member description: System.Object.GetType
C# Syntax:
public Type GetType();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: MemberwiseClone()
Inherited
See base class member description: System.Object.MemberwiseClone
C# Syntax:
protected object MemberwiseClone();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: ToString()
Inherited
See base class member description: System.ValueType.ToString

Summary
Returns the fully qualified type name of this instance.
C# Syntax:
public override string ToString();
Return Value:
A String containing a fully qualified type name.

Return to top


Top of page

Copyright (c) 2002 Microsoft Corporation. All rights reserved.