Home c# What is the nervous?

What is the nervous?




As I understood the nerd can need to be needed to use the library written on C, in the program on C #.
Does the corporal of the library?

Answer 1, Authority 100%

Wrapper is translated as “wrapper”. Since I do not see the point of use of unnecessary agencies, preferred the translated term.

The wrapper is required if one subsystem requires the implementation of a specific interface, and the other subsystem in which the desired functionality is implemented does not implement this interface. Then a lightweight class is written, implementing the required interface and delegating calls for the second subsystem methods. After that, this class is transmitted to the first subsystem, thanks to which it can work with the second subsystem through its native interface.

For example, in .NET there is an abstraction “stream” represented by the basic abstract class Stream. This abstraction is used by such subsystems, such as serializers. And then we can, inherited from class Stream, implement streaming access to any data source, and then any serializer will work with this data source through the stream interface.

“Library on C” is a special case of the second subsystem. In this case, the interaction mechanism itself is being wrapped: for unmanaged libraries, the main method of external interaction is exported functions, and for managed – public types. The wrapper over the C-library is placed in the .NET environment, and work with the library occurs through an appeal to .NET-type, which, at a minimum, must contain methods imported from the library (without body, with the External modifier and the Dlimimport attribute). If any additional processing is required, then imported methods should be made private, and to outward the methods causing imported and making auxiliary work.

Answer 2, Authority 21%

Aircraft is a whewl of some functionality, a specific class or a member of the class, which will wrap the functions of something for use in another environment, for example.

More specifically: if you, suppose you need to use any of the WinAPI functions using P / INVOKE, you must write a method that makes it a call to this function, processes exceptions and output of this function. In this case, it is said that this is a METTER METHOD FOR WINAPI FUNCTION

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions