For a WaveNetDevice, the value can be accessed using the Attribute
"/NodeList/*/DeviceList/*/$ns3::WaveNetDevice/MacEntities/*/$ns3::OcbWifiMac/*/Queue"
I think the example you show is using WifiNetDevice, so the path will differ. I personally prefer using WaveNetDevice.
Note that "Attributes" defined in a parent class of a given class are also accessible. If you look at the code for OcbWifiMac (ocb-wifi-mac.cc), which is the Mac used for 802.11p/Wave, you notice it doesn't define any attributes. If you look into its parent class, RegularWifiMac, you will notice that it defines attributes (of type ns3::Txop & ns3::QosTxop) and that's where we get the attribute "Queue", which is defined in Txop.
So, RegularWifiMac has 5 queues denoted by the attributes VO_Txop, VI_Txop, BE_Txop, BK_Txop and "Txop", the last one is the non-QoS queue.
The way ns3 implements the queuing, it attaches a timestamp to WifiMacQueueItem objects as they're en queued. You can trace queuing & de-queuing using the traces sources. After you create the devices, and before starting the simulation add:
std::string enqueue_path= "/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/*/$ns3::OcbWifiMac/*/Queue/Enqueue";
std::string dequeue_path= "/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/*/$ns3::OcbWifiMac/*/Queue/Dequeue";
Config::Connect (enqueue_path, MakeCallback (&EnqueueTrace));
Config::Connect (dequeue_path, MakeCallback (&DequeueTrace));
and add these two functions to the file
void EnqueueTrace(std::string context, Ptr<const WifiMacQueueItem> item) {
//what to do when a packet is enqueued
//You can print the context (what nodes, what channel, etc)
std::cout << "Context : " << context << std::endl;
}
void DequeueTrace(std::string context, Ptr<const WifiMacQueueItem> item) {
//what to do when the packet is dequeued. You can do something like
Time delay = Simulator::Now() - item->GetTimeStamp();
std::cout << "Delay : " << delay << std::endl;
}