Open Search
    FirstValueReceiver< T > Class Template Reference

    #include <valuereceiver.h>

    Detailed Description

    template<typename T>
    class maxon::FirstValueReceiver< T >

    ValueReceiver type that will copy the first found value for later access. Useful for calls such as GetConnections when we are interested in getting details about the first connection found. Iterations stop after a value is found. of the given type.

    String myString;
    ...
    FirstValueReceiver<const String&> recv;
    myString.Split('a', false, recv) iferr_return;
    if (recv.IsPopulated())
    DiagnosticOutput("Found first value");
    Definition: c4d_string.h:39
    Bool IsPopulated() const
    Definition: string.h:1449
    #define DiagnosticOutput(formatString,...)
    Definition: debugdiagnostics.h:176
    #define iferr_return
    Definition: resultbase.h:1521

    Public Member Functions

     operator ValueReceiver< T > ()
     
    const Opt< typename std::decay< T >::type > & Get () const
     
    Bool IsPopulated () const
     
    Bool IsEmpty () const
     
    void Reset ()
     

    Private Attributes

    Opt< typename std::decay< T >::type_value
     

    Member Function Documentation

    ◆ operator ValueReceiver< T >()

    operator ValueReceiver< T > ( )

    ◆ Get()

    const Opt<typename std::decay<T>::type>& Get ( ) const

    ◆ IsPopulated()

    Bool IsPopulated ( ) const

    ◆ IsEmpty()

    Bool IsEmpty ( ) const

    ◆ Reset()

    void Reset ( )

    Member Data Documentation

    ◆ _value

    Opt<typename std::decay<T>::type> _value
    private