# NvElement Class Reference
[NvElement Base Class]

Every element has a unique name that can be used for identifying the element in debug logs. More...

`#include <NvElement.h>`

Inheritance diagram for NvElement:

List of all members.

## Public Member Functions

virtual int | isInError ()
| Indicates if the element encountered an error during its operation.
virtual | ~NvElement ()
void | getProfilingData (NvElementProfiler::NvElementProfilerData &data)
| Get profiling data for the element.
void | printProfilingStats (std::ostream &out_stream=std::cout)
| Print profiling data for the element to an output stream.
virtual void | enableProfiling ()
| Enable profiling for the element.
bool | isProfilingEnabled ()
| Check if profiling has been enabled for the element.

## Protected Member Functions

| NvElement (const char *name, NvElementProfiler::ProfilerField=NvElementProfiler::PROFILER_FIELD_NONE)
| Creates a new NvElement object with name name.
| NvElement (const NvElement &that)
| Disallow copy constructor.
void | operator= (NvElement const &)
| Disallow assignment.

## Protected Attributes

int | is_in_error
| Indicates if an error was encountered during the operation of the element.
const char * | comp_name
| Specifies the name of the component, for debugging.
NvElementProfiler | profiler
| Profiler for the element.

## Detailed Description

Every element has a unique name that can be used for identifying the element in debug logs.

`NvElement` also provides other common functionality, such as keeping track of errors.

Definition at line 63 of file NvElement.h.

## Constructor & Destructor Documentation

virtual NvElement::~NvElement | ( |  | ) | `[inline, virtual]`

Definition at line 76 of file NvElement.h.

NvElement::NvElement | ( | const char * | name,
|  | NvElementProfiler::ProfilerField | fields = `NvElementProfiler::PROFILER_FIELD_NONE` |
| ) |  |  | `[protected]`

Creates a new NvElement object with name name.

If the name parameter is NULL, this method sets the internal error variable.

Parameters:

  `[in]` | name | If non-NULL, a pointer to the name of the element.

Definition at line 53 of file NvElement.cpp.

NvElement::NvElement | ( | const NvElement & | that | ) | `[protected]`

Disallow copy constructor.

## Member Function Documentation

void NvElement::enableProfiling | ( |  | ) | `[virtual]`

Enable profiling for the element.

Reimplemented in NvV4l2Element.

Definition at line 43 of file NvElement.cpp.

void NvElement::getProfilingData | ( | NvElementProfiler::NvElementProfilerData & | data | ) |

Get profiling data for the element.

Returns:
  A constant reference to the element's profiling data.

Definition at line 31 of file NvElement.cpp.

virtual int NvElement::isInError | ( |  | ) | `[inline, virtual]`

Indicates if the element encountered an error during its operation.

Returns:
  0 if no error was encountered, a non-zero value if an error was encountered.

Reimplemented in NvV4l2Element.

Definition at line 72 of file NvElement.h.

bool NvElement::isProfilingEnabled | ( |  | ) |

Check if profiling has been enabled for the element.

Returns:
  Boolean value indicating if profiling has been enabled.

Definition at line 48 of file NvElement.cpp.

void NvElement::operator= | ( | NvElement const & |  | ) | `[protected]`

Disallow assignment.

void NvElement::printProfilingStats | ( | std::ostream & | out_stream = `std::cout` | ) |

Print profiling data for the element to an output stream.

Parameters:

  `[in]` | out_stream | Output stream of type std::ostream to print the data to. Takes default value std::cout if not specified.

Definition at line 36 of file NvElement.cpp.

## Member Data Documentation

const char* NvElement::comp_name `[protected]`

Specifies the name of the component, for debugging.

Definition at line 122 of file NvElement.h.

int NvElement::is_in_error `[protected]`

Indicates if an error was encountered during the operation of the element.

Definition at line 120 of file NvElement.h.

NvElementProfiler NvElement::profiler `[protected]`

Profiler for the element.

Definition at line 124 of file NvElement.h.

The documentation for this class was generated from the following files:

- include/NvElement.h
- samples/common/classes/NvElement.cpp