samedi 9 septembre 2017

How to run according to interface type

I need for a code to run according to the interface called, for example in the following code:

public class VirtualStreamingFiler : IBFiler, IAFiler
{
    public VirtualStreamingFiler()
    {
        cout << "I like " << interface_func_type_return() << " too!\n";
    }
}

interface_func_type_return() will return a string according to the interface used, if IAFiler then return "A_string_request", if IBFiler return "general_purpose_B"

int main ()
{
  IAFiler _vpnFiler = new VirtualStreamingFiler();
  return 0;
}

so the output here will be:

A_string_request

How do I do that??

Thank you

Aucun commentaire:

Enregistrer un commentaire