Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help just writing a fragment of code in C++, the code is incomplete I just need help writing the constructor. I have highlighted the

Need help just writing a fragment of code in C++, the code is incomplete I just need help writing the constructor. I have highlighted the area that needs the code added in

Write a public default constructor for signal_handler_op as follows:

  • construct the type_ member with op_type::default_, and,
  • constructs sa_handler_ with the value of DEFAULT

Code Below:

class signal_handler_op {

private:

enum class op_type { error, default_, ignore, traditional, sigaction };

public:

using traditional_op_type = void(*)(int); using sigaction_op_type = void(*)(int, siginfo_t * , void *);

private:

traditional_op_type static const ERROR;

traditional_op_type static const IGNORE; traditional_op_type static const DEFAULT;

op_type type_;

union { traditional_op_type sa_handler_; sigaction_op_type sa_sigaction_; };

public:

/* FIX/FINISH THE CODE BELOW */

signal_handler_op(): default; //default constructor

type_ op_type::default_

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Oracle Solaris 11 System Administration

Authors: Bill Calkins

1st Edition

0133007170, 9780133007176

More Books

Students also viewed these Databases questions