title: c++ class organization using level access
body: <p>I am a newbie in  C++. I have a project to create a library for my robot. Basically, the main class is ROBOT, then the second levels are: LIGHT, MOTOR. Then, for the LIGHT level, there are the methods: Set_ON_OFF, Set_color, Set_brightness. For the MOTOR level, there are the methods: Set_right_left, Set_power, Set_move_back. So the multi-level class ROBOT is organized like:</p>
  
  <p><strong>ROBOT</strong></p>
  
  <ol>
  <li>LIGHT
  
  <ul>
  <li>Set_ON_OFF</li>
  <li>Set_color</li>
  <li>Set_brightness</li>
  </ul></li>
  <li>MOTOR
  
  <ul>
  <li>Set_right_left</li>
  <li>Set_power</li>
  <li>Set_move_back</li>
  </ul></li>
  </ol>
  
  <p>In the main program, I want to call the methods like that:</p>
  
  <pre><code>ROBOT obj_robot;
  
  obj_robot.LIGHT.Set_ON_OFF = 1;
  obj_robot.LIGHT.Set_color= 135;
  obj_robot.LIGHT.Set_brightness= 75;
  
  obj_robot.MOTOR.Set_right_left= 0;
  obj_robot.MOTOR.Set_power= 85;
  obj_robot.MOTOR.Set_move_back= 1;
  </code></pre>
  
  <p>How can I implement such class organization?</p>
  
  <p>Thank you for your help.</p>
  
  <p>Cedric</p>